diff --git a/d2common/d2fileformats/d2tbl/text_dictionary.go b/d2common/d2fileformats/d2tbl/text_dictionary.go index cb108dd8..4413d5c2 100644 --- a/d2common/d2fileformats/d2tbl/text_dictionary.go +++ b/d2common/d2fileformats/d2tbl/text_dictionary.go @@ -230,7 +230,7 @@ func (td *TextDictionary) Marshal() []byte { sw.PushUint16(uint16(len(value) + 1)) } - // data stream: put all data in appropiate order + // data stream: put all data in appropriate order for key, value := range *td { for _, i := range key { sw.PushBytes(byte(i)) diff --git a/d2common/d2fileformats/d2tbl/text_dictionary_test.go b/d2common/d2fileformats/d2tbl/text_dictionary_test.go index df5012cf..bfb0794a 100644 --- a/d2common/d2fileformats/d2tbl/text_dictionary_test.go +++ b/d2common/d2fileformats/d2tbl/text_dictionary_test.go @@ -1,8 +1,6 @@ package d2tbl import ( - "fmt" - "testing" ) @@ -27,10 +25,11 @@ func TestTBL_Marshal(t *testing.T) { for key, value := range *tbl { newValue, ok := newTbl[key] - fmt.Println(newValue, value) + if !ok { t.Fatal("string wasn't encoded to table") } + if newValue != value { t.Fatal("unexpected value set") }