Skip to content

Commit 5369e2c

Browse files
committed
update comparison and terms tests to pass
1 parent 3032832 commit 5369e2c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

languages/go/xorm/e2e_test.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"encoding/json"
45
"fmt"
56
"log"
67
"reflect"
@@ -441,7 +442,6 @@ func TestJsonbComparisonOp(t *testing.T) {
441442

442443
assert.Equal(t, int64(2), inserted, "Expected to insert 2 rows")
443444

444-
t.Skip("TODO: Fix failing test due to issue with cllw ore")
445445
path := "$.top.integer"
446446
ejson_path, err := goeql.EJsonPathQuery(path, "examples", "encrypted_jsonb_field")
447447

@@ -494,13 +494,15 @@ func TestJsonbTermsOp(t *testing.T) {
494494
EncryptedTextField: "testing",
495495
EncryptedIntField: 42,
496496
EncryptedJsonbField: jsonOne,
497+
EncryptedBoolField: true,
497498
}
498499
example_two := Example{
499500
Id: expected_id,
500501
NonEncryptedField: "melbourne",
501502
EncryptedIntField: 42,
502503
EncryptedTextField: "someone@gmail.com",
503504
EncryptedJsonbField: jsonTwo,
505+
EncryptedBoolField: false,
504506
}
505507

506508
examples := []Example{
@@ -536,13 +538,20 @@ func TestJsonbTermsOp(t *testing.T) {
536538
if err != nil {
537539
log.Fatalf("Error serializing encrypted_jsonb_field query: %v", err)
538540
}
539-
t.Skip("TODO: Fix failing test due to issue with cllw ore")
541+
540542
results, err := engine.Query(sql, ejson_path, comparison_value)
541543
if err != nil {
542544
t.Fatalf("Could not retrieve example using terms: %v", err)
543545
}
544546

545547
assert.Equal(t, 1, len(results))
548+
549+
var jsonData int64
550+
if err := json.Unmarshal(results[0]["id"], &jsonData); err != nil {
551+
t.Fatalf("Could not unmarshal %v", err)
552+
}
553+
assert.Equal(t, expected_id, jsonData)
554+
546555
}
547556

548557
func TestOreStringRangeQuery(t *testing.T) {

0 commit comments

Comments
 (0)