diff --git a/builtins_test.go b/builtins_test.go index 875933a..4a18ca0 100644 --- a/builtins_test.go +++ b/builtins_test.go @@ -331,8 +331,8 @@ func TestBuiltinLayoutErrorsNameARunnableSpelling(t *testing.T) { t.Errorf("%v names a layout that renders its own quotes", err) } _, err = compile(parse(t, `"{time(15:04)}"`)) - if err == nil || !strings.Contains(err.Error(), "write '15:04'") || !strings.Contains(err.Error(), "shell") { - t.Fatalf("a bare layout = %v, want it named quoted and the shell explained", err) + if err == nil || !strings.Contains(err.Error(), "write '15:04'") { + t.Fatalf("a bare layout = %v, want it named quoted", err) } // The comma hint belongs to a layout that split, not to a call given extra args. _, err = compile(parse(t, `"{time(0,12,'15:04')}"`)) diff --git a/data_test.go b/data_test.go index 4051ca3..3e9de3e 100644 --- a/data_test.go +++ b/data_test.go @@ -413,4 +413,10 @@ func TestShippedUSTitleAgreesWithSex(t *testing.T) { t.Errorf("en_US.person.prefix never drew %q in 3000 draws", want) } } + swedish := map[string]bool{"dr": true, "prof": true} + for i := 0; i < 50; i++ { + if got := fake(t, f, "sv_SE.title"); !swedish[got] { + t.Fatalf("sv_SE.title = %q, want an unsexed Swedish honorific", got) + } + } } diff --git a/record_test.go b/record_test.go index e5ec7a3..00f00a4 100644 --- a/record_test.go +++ b/record_test.go @@ -553,7 +553,7 @@ func TestRecordTemplateRejectsATopLevelRepeat(t *testing.T) { // error names the record that gives it one. func TestRecordOfAFieldlessCategoryNamesTheWrapper(t *testing.T) { f := newGenerator(t, "data", WithSeed(1)) - want := `'{"format":"","personnummer":"{/sv_SE.personnummer}"}'` + want := `{"format":"","personnummer":"{/sv_SE.personnummer}"}` _, err := f.FakeRecord("sv_SE.personnummer") if err == nil || !strings.Contains(err.Error(), want) { t.Fatalf("FakeRecord(sv_SE.personnummer) = %v, want it to name %s", err, want)