diff options
Diffstat (limited to 'dictionary_test.go')
| -rw-r--r-- | dictionary_test.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/dictionary_test.go b/dictionary_test.go new file mode 100644 index 0000000..b9861fe --- /dev/null +++ b/dictionary_test.go @@ -0,0 +1,32 @@ +// Copyright 2020, Shulhan <ms@kilabit.info>. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package kamusd + +import ( + "testing" + + "github.com/shuLhan/share/lib/test" +) + +func TestDictionary_store_load(t *testing.T) { + exp, err := newDictionary(testKamusStorage) + if err != nil { + t.Fatal(err) + } + + exp.set("mengeja", testKataMengeja) + + err = exp.store() + if err != nil { + t.Fatal(err) + } + + got, err := newDictionary(testKamusStorage) + if err != nil { + t.Fatal(err) + } + + test.Assert(t, "store and load", exp, got, true) +} |
