github.com/MontFerret/ferret@v0.18.0/pkg/runtime/core/source_test.go (about) 1 package core_test 2 3 import ( 4 "fmt" 5 "testing" 6 7 . "github.com/smartystreets/goconvey/convey" 8 9 "github.com/MontFerret/ferret/pkg/runtime/core" 10 ) 11 12 func TestNewSourceMap(t *testing.T) { 13 Convey("Should match", t, func() { 14 s := core.NewSourceMap("test", 1, 100) 15 sFmt := fmt.Sprintf("%s at %d:%d", "test", 1, 100) 16 17 So(s, ShouldNotBeNil) 18 19 So(s.Line(), ShouldEqual, 1) 20 21 So(s.Column(), ShouldEqual, 100) 22 23 So(s.String(), ShouldEqual, sFmt) 24 }) 25 }