diff --git a/v5/pkg/walkers/semantics/walk.go b/v5/pkg/walkers/semantics/walk.go index a36b735..02f6ede 100644 --- a/v5/pkg/walkers/semantics/walk.go +++ b/v5/pkg/walkers/semantics/walk.go @@ -443,13 +443,13 @@ func handleDateOp(n tsl.Node, eval EvalFunc) (bool, error) { case tsl.NotEqOp: return left != right, nil case tsl.LtOp: - return right.Before(left), nil + return right.After(left), nil case tsl.LteOp: - return !right.After(left), nil + return !right.Before(left), nil case tsl.GtOp: - return left.Before(right), nil + return left.After(right), nil case tsl.GteOp: - return !left.After(right), nil + return !left.Before(right), nil } return false, tsl.UnexpectedLiteralError{Literal: n.Func} diff --git a/v5/pkg/walkers/semantics/walk_test.go b/v5/pkg/walkers/semantics/walk_test.go index 1a52257..82c35c4 100644 --- a/v5/pkg/walkers/semantics/walk_test.go +++ b/v5/pkg/walkers/semantics/walk_test.go @@ -28,7 +28,7 @@ import ( func TestWalk(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Walk") + RunSpecs(t, "Semantic walker") } var _ = Describe("Walk", func() { @@ -82,7 +82,7 @@ var _ = Describe("Walk", func() { // dates Entry("dates", "date = 2020-01-01T00:00:00Z", true), - Entry("dates", "date < 2020-01-02T00:00:00Z", false), + Entry("dates", "date > 2020-01-02T00:00:00Z", false), Entry("dates", "date between 2019-12-30T00:00:00Z and 2020-01-02T00:00:00Z", true), ) })