2019-01-15 21:14:16 +03:00
|
|
|
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"}
|
2019-02-23 00:39:07 +03:00
|
|
|
assert.Equal(t, "Parse Error: test\n\tat 1:10", err.Error())
|
2019-01-15 21:14:16 +03:00
|
|
|
}
|