github.com/MontFerret/ferret@v0.18.0/pkg/compiler/compiler_eq_test.go (about) 1 package compiler_test 2 3 import ( 4 "context" 5 "testing" 6 7 . "github.com/smartystreets/goconvey/convey" 8 9 "github.com/MontFerret/ferret/pkg/compiler" 10 "github.com/MontFerret/ferret/pkg/runtime" 11 ) 12 13 func TestEqualityOperators(t *testing.T) { 14 Convey("Should compile RETURN 2 > 1", t, func() { 15 c := compiler.New() 16 17 p, err := c.Compile(` 18 RETURN 2 > 1 19 `) 20 21 So(err, ShouldBeNil) 22 So(p, ShouldHaveSameTypeAs, &runtime.Program{}) 23 24 out, err := p.Run(context.Background()) 25 26 So(err, ShouldBeNil) 27 So(string(out), ShouldEqual, "true") 28 }) 29 }