1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-10-16 07:03:52 -04:00
OpenDiablo2/d2common/d2fileformats/d2tbl/text_dictionary_test.go
2021-02-25 11:58:32 +01:00

32 lines
445 B
Go

package d2tbl
import (
"fmt"
"testing"
)
func exampleData() *TextDictionary {
result := &TextDictionary{
"abc": "def",
"someStr": "Some long string",
"lolstring": "lol",
}
return result
}
func TestTBL_Marshal(t *testing.T) {
tbl := exampleData()
data := tbl.Marshal()
newTbl, err := LoadTextDictionary(data)
if err != nil {
t.Error(err)
}
_, ok := newTbl["lolstring"]
if !ok {
t.Fatal("no string found")
}
}