From 8dfa107bc4baf32d2b59b8ccee4d5f36d3925bf3 Mon Sep 17 00:00:00 2001 From: vadim Date: Mon, 4 Dec 2017 12:56:55 +0200 Subject: [PATCH] pretty test errors --- test/node_scalar_string_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/node_scalar_string_test.go b/test/node_scalar_string_test.go index 544c05b..7647ba1 100644 --- a/test/node_scalar_string_test.go +++ b/test/node_scalar_string_test.go @@ -2,9 +2,9 @@ package test import ( "bytes" - "reflect" "testing" + "github.com/kylelemons/godebug/pretty" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/parser" "github.com/z7zmey/php-parser/token" @@ -19,7 +19,7 @@ func TestNewNodeScalarString(t *testing.T) { node := parser.Parse(bytes.NewBufferString(src), "test.php") - if !reflect.DeepEqual(expected, node) { - t.Error("Not equal") + if diff := pretty.Compare(expected, node); diff != "" { + t.Errorf("post-AddCrew diff: (-expected +actual)\n%s", diff) } }