Skip to content

Commit a6a75c2

Browse files
committed
lte test allows for doubles
1 parent 987b3ec commit a6a75c2

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

internal/integration/unified/matches.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,11 @@ func evaluateSpecialComparison(ctx context.Context, assertionDoc bson.Raw, actua
242242
return fmt.Errorf("expected lsid %v, got %v", expectedID, actualID)
243243
}
244244
case "$$lte":
245-
if assertionVal.Type != bson.TypeInt32 && assertionVal.Type != bson.TypeInt64 {
246-
return fmt.Errorf("expected assertionVal to be an Int32 or Int64 but got a %s", assertionVal.Type)
245+
if assertionVal.Type != bson.TypeInt32 && assertionVal.Type != bson.TypeInt64 && assertionVal.Type != bson.TypeDouble {
246+
return fmt.Errorf("expected assertionVal to be an Int32, Int64, or Double but got a %s", assertionVal.Type)
247247
}
248-
if actual.Type != bson.TypeInt32 && actual.Type != bson.TypeInt64 {
249-
return fmt.Errorf("expected value to be an Int32 or Int64 but got a %s", actual.Type)
248+
if actual.Type != bson.TypeInt32 && actual.Type != bson.TypeInt64 && assertionVal.Type != bson.TypeDouble {
249+
return fmt.Errorf("expected value to be an Int32, Int64, or Double but got a %s", actual.Type)
250250
}
251251

252252
// Numeric values can be compared even if their types are different (e.g. if expected is an int32 and actual

internal/spectest/skip.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ import "testing"
1111
// skipTests is a map of "fully-qualified test name" to "the reason for skipping
1212
// the test".
1313
var skipTests = map[string][]string{
14-
// TODO(GODRIVER-3518): Test flexible numeric comparisons with $$lte
15-
"Modifies $$lte operator test to also use floating point and Int64 types (GODRIVER-3518)": {
16-
"TestUnifiedSpec/unified-test-format/tests/valid-pass/operator-lte.json/special_lte_matching_operator",
17-
},
1814

1915
// SPEC-1403: This test checks to see if the correct error is thrown when auto
2016
// encrypting with a server < 4.2. Currently, the test will fail because a

0 commit comments

Comments
 (0)