mirror of
https://github.com/MontFerret/ferret.git
synced 2025-06-06 23:36:17 +02:00
28 lines
549 B
Go
28 lines
549 B
Go
|
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()
|
||
|
|
||
|
prog, err := c.Compile(`
|
||
|
RETURN 2 > 1
|
||
|
`)
|
||
|
|
||
|
So(err, ShouldBeNil)
|
||
|
So(prog, ShouldHaveSameTypeAs, &runtime.Program{})
|
||
|
|
||
|
out, err := prog.Run(context.Background())
|
||
|
|
||
|
So(err, ShouldBeNil)
|
||
|
So(string(out), ShouldEqual, "true")
|
||
|
})
|
||
|
}
|