1
0
mirror of https://github.com/MontFerret/ferret.git synced 2024-12-14 11:23:02 +02:00
ferret/pkg/compiler/compiler_eq_test.go

28 lines
540 B
Go
Raw Normal View History

package compiler_test
import (
"context"
"github.com/MontFerret/ferret/pkg/compiler"
"github.com/MontFerret/ferret/pkg/runtime"
. "github.com/smartystreets/goconvey/convey"
"testing"
)
func TestEqualityOperators(t *testing.T) {
Convey("Should compile RETURN 2 > 1", t, func() {
c := compiler.New()
2018-10-25 01:40:57 +02:00
p, err := c.Compile(`
RETURN 2 > 1
`)
So(err, ShouldBeNil)
2018-10-25 01:40:57 +02:00
So(p, ShouldHaveSameTypeAs, &runtime.Program{})
2018-10-25 01:40:57 +02:00
out, err := p.Run(context.Background())
So(err, ShouldBeNil)
So(string(out), ShouldEqual, "true")
})
}