fix PrettyToNbt test to include empty text field and improve error formatting
This commit is contained in:
+2
-2
@@ -229,7 +229,7 @@ func TestPrettyToNbt(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "real data",
|
name: "real data",
|
||||||
f: `§dno gooning`,
|
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",
|
name: "reset thing",
|
||||||
@@ -242,7 +242,7 @@ func TestPrettyToNbt(t *testing.T) {
|
|||||||
a := Pretty(tt.f).AsNBT()
|
a := Pretty(tt.f).AsNBT()
|
||||||
b := tt.want
|
b := tt.want
|
||||||
if !cmp.Equal(a, b) {
|
if !cmp.Equal(a, b) {
|
||||||
t.Errorf("PrettyToNbt() = %v, want %v", a, b)
|
t.Errorf("PrettyToNbt() = %#v, want %#v", a, b)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user