Skip to content

Commit 5f4799c

Browse files
committed
Break multiple dictionary test into own function
1 parent c5ac798 commit 5f4799c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

spell_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,16 @@ func TestLookup(t *testing.T) {
194194
if suggestions[0].Word != "ex𝐚mple" {
195195
t.Fatal(fmt.Sprintf("Expected ex𝐚mple, got %s", suggestions[0].Word))
196196
}
197+
}
198+
199+
func TestLookup_multipleDictionaries(t *testing.T) {
200+
s, err := newWithExample()
201+
if err != nil {
202+
t.Fatal(err)
203+
}
197204

198205
// Test adding a word to a different dictionary
199-
ok, err = s.AddEntry(Entry{
206+
ok, err := s.AddEntry(Entry{
200207
Word: "française",
201208
}, Name("french"))
202209
if err != nil {
@@ -207,7 +214,7 @@ func TestLookup(t *testing.T) {
207214
}
208215

209216
// Shouldn't get word from default dictionary
210-
suggestions, err = s.Lookup("française")
217+
suggestions, err := s.Lookup("française")
211218
if err != nil {
212219
t.Fatal(err)
213220
}

0 commit comments

Comments
 (0)