rename fastnbt -> dynbt. add some NewXXX api

This commit is contained in:
Tnze
2023-04-25 01:10:15 +08:00
parent 37d4179bb2
commit 9582bc2a7e
8 changed files with 99 additions and 9 deletions

View File

@ -428,6 +428,22 @@ func TestDecoder_Decode_textUnmarshaler(t *testing.T) {
if b != true {
t.Errorf("b should be true")
}
var s struct {
A TextBool
}
data = []byte{
TagCompound, 0, 0,
TagString, 0, 1, 'A', 0, 4, 't', 'r', 'u', 'e',
TagEnd,
}
_, err = NewDecoder(bytes.NewReader(data)).Decode(&s)
if err != nil {
t.Fatal(err)
}
if s.A != true {
t.Errorf("s.A should be true")
}
}
func TestDecoder_Decode_ErrorUnknownField(t *testing.T) {