fix PrettyToNbt test to include empty text field and improve error formatting

This commit is contained in:
adman
2026-05-03 14:58:04 +02:00
parent 66f32b4cd2
commit 35030601e1
+2 -2
View File
@@ -229,7 +229,7 @@ func TestPrettyToNbt(t *testing.T) {
{
name: "real data",
f: `§dno gooning`,
want: nbt.Anon{Value: map[string]interface{}{"extra": []interface{}{map[string]interface{}{"color": "light_purple", "text": "no gooning"}}}},
want: nbt.Anon{Value: map[string]interface{}{"extra": []interface{}{map[string]interface{}{"color": "light_purple", "text": "no gooning"}}, "text": ""}},
},
{
name: "reset thing",
@@ -242,7 +242,7 @@ func TestPrettyToNbt(t *testing.T) {
a := Pretty(tt.f).AsNBT()
b := tt.want
if !cmp.Equal(a, b) {
t.Errorf("PrettyToNbt() = %v, want %v", a, b)
t.Errorf("PrettyToNbt() = %#v, want %#v", a, b)
}
})
}