pretty test errors

This commit is contained in:
vadim 2017-12-04 12:56:55 +02:00
parent 7c3d593097
commit 8dfa107bc4

View File

@ -2,9 +2,9 @@ package test
import ( import (
"bytes" "bytes"
"reflect"
"testing" "testing"
"github.com/kylelemons/godebug/pretty"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/parser" "github.com/z7zmey/php-parser/parser"
"github.com/z7zmey/php-parser/token" "github.com/z7zmey/php-parser/token"
@ -19,7 +19,7 @@ func TestNewNodeScalarString(t *testing.T) {
node := parser.Parse(bytes.NewBufferString(src), "test.php") node := parser.Parse(bytes.NewBufferString(src), "test.php")
if !reflect.DeepEqual(expected, node) { if diff := pretty.Compare(expected, node); diff != "" {
t.Error("Not equal") t.Errorf("post-AddCrew diff: (-expected +actual)\n%s", diff)
} }
} }