mirror of
https://github.com/MontFerret/ferret.git
synced 2024-12-14 11:23:02 +02:00
add unit tests for runtime/core - source (#126)
This commit is contained in:
parent
2bb67f6a90
commit
e64eb18ccf
24
pkg/runtime/core/source_test.go
Normal file
24
pkg/runtime/core/source_test.go
Normal file
@ -0,0 +1,24 @@
|
||||
package core_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/MontFerret/ferret/pkg/runtime/core"
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
)
|
||||
|
||||
func TestNewSourceMap(t *testing.T) {
|
||||
Convey("Should match", t, func() {
|
||||
s := core.NewSourceMap("test", 1, 100)
|
||||
sFmt := fmt.Sprintf("%s at %d:%d", "test", 1, 100)
|
||||
|
||||
So(s, ShouldNotBeNil)
|
||||
|
||||
So(s.Line(), ShouldEqual, 1)
|
||||
|
||||
So(s.Column(), ShouldEqual, 100)
|
||||
|
||||
So(s.String(), ShouldEqual, sFmt)
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue
Block a user