xgo/compiler/parser/error_test.go
earncef 6dd573c3f6 Runtime error trace format (#111)
* Runtime error format

* Parser and Compiler error formats updated
2019-02-22 13:39:07 -08:00

14 lines
343 B
Go

package parser_test
import (
"testing"
"github.com/d5/tengo/assert"
"github.com/d5/tengo/compiler/parser"
"github.com/d5/tengo/compiler/source"
)
func TestError_Error(t *testing.T) {
err := &parser.Error{Pos: source.FilePos{Offset: 10, Line: 1, Column: 10}, Msg: "test"}
assert.Equal(t, "Parse Error: test\n\tat 1:10", err.Error())
}