@@ -95,7 +95,7 @@ module TestDynamoDBFilterExpr {
95
95
method {:test} TestBasicParse () {
96
96
var context := ExprContext (
97
97
None,
98
- Some("std2 <> :A AND #Field4 = :B "),
98
+ Some("std2 = :A AND #Field4 = :B "),
99
99
Some (map[
100
100
":A " := DDB.AttributeValue.N("1.23"),
101
101
":B" := DDB. AttributeValue. S ("abc")
@@ -117,13 +117,13 @@ module TestDynamoDBFilterExpr {
117
117
118
118
var newContext :- expect BeaconizeParsedExpr (beaconVersion, parsed, 0, context.values.value, context.names, DontUseKeys, map[]);
119
119
var exprString := ParsedExprToString (newContext.expr);
120
- expect exprString == "aws_dbe_b_std2 <> :A AND #Field4 = :B";
120
+ expect exprString == "aws_dbe_b_std2 = :A AND #Field4 = :B";
121
121
}
122
122
123
123
method {:test} TestNoBeaconFail () {
124
124
var context := ExprContext (
125
125
None,
126
- Some("std2 <> :A AND #Field4 = :B "),
126
+ Some("std2 = :A AND #Field4 = :B "),
127
127
Some (map[
128
128
":A " := DDB.AttributeValue.N("1.23"),
129
129
":B" := DDB. AttributeValue. S ("abc")
@@ -150,15 +150,15 @@ module TestDynamoDBFilterExpr {
150
150
var badBeacon := TestBeaconize (FullTableConfig.attributeActions, None, Some("std2 <> :A AND #Field4 = :B "), None);
151
151
expect badBeacon. Failure?;
152
152
expect badBeacon. error == E ("Query is using encrypted field : std2 .");
153
- badBeacon := TestBeaconize (FullTableConfig.attributeActions, Some("std2 <> :A AND #Field4 = :B "), None, None);
153
+ badBeacon := TestBeaconize (FullTableConfig.attributeActions, Some("std2 = :A AND #Field4 = :B "), None, None);
154
154
expect badBeacon. Failure?;
155
155
expect badBeacon. error == E ("Query is using encrypted field : std2 .");
156
156
}
157
157
158
158
method {:test} {:vcs_split_on_every_assert} TestBasicBeacons () {
159
159
var context := ExprContext (
160
160
None,
161
- Some("std2 <> :A AND #Field4 = :B "),
161
+ Some("std2 = :A AND #Field4 = :B "),
162
162
Some (map[
163
163
":A " := Std2String,
164
164
":B " := Std4String
@@ -171,7 +171,7 @@ module TestDynamoDBFilterExpr {
171
171
var src := GetLiteralSource ([1,2,3,4,5], version);
172
172
var beaconVersion :- expect ConvertVersionWithSource (FullTableConfig, version, src);
173
173
var newContext :- expect Beaconize (beaconVersion, context, DontUseKeyId);
174
- expect_equal (newContext.filterExpr, Some("aws_dbe_b_std2 <> :A AND #Field4 = :B "));
174
+ expect_equal (newContext.filterExpr, Some("aws_dbe_b_std2 = :A AND #Field4 = :B "));
175
175
var newName := "aws_dbe_b_std4";
176
176
expect IsValid_AttributeName (newName);
177
177
var expectedNames: DDB. ExpressionAttributeNameMap := map ["#Field4" := newName];
@@ -581,6 +581,34 @@ module TestDynamoDBFilterExpr {
581
581
expect newItems. error == E ("To use BETWEEN with a compound beacon, the part after any common prefix must be LessThanComparable : BETWEEN T_ATitle AND T_MyTitle");
582
582
}
583
583
584
+ method {:test} TestBadStandard () {
585
+
586
+ var values : DDB. ExpressionAttributeValueMap := map [
587
+ ":val" := DS ("foo")
588
+ ];
589
+
590
+ var version := GetLotsaBeacons ();
591
+ var src := GetLiteralSource ([1,2,3,4,5], version);
592
+ var bv :- expect ConvertVersionWithSource (FullTableConfig, version, src);
593
+ var newItems := FilterResults (bv, [SimpleItem], None, Some("std2 = :val "), None, Some (values));
594
+ expect newItems. Success?;
595
+ newItems := FilterResults (bv, [SimpleItem], None, Some("std2 <> :val "), None, Some (values));
596
+ expect newItems. Failure?;
597
+ expect newItems. error == E ("The operation '<>' cannot be used with a standard beacon.");
598
+ newItems := FilterResults (bv, [SimpleItem], None, Some("std2 < :val "), None, Some (values));
599
+ expect newItems. Failure?;
600
+ expect newItems. error == E ("The operation '<' cannot be used with a standard beacon.");
601
+ newItems := FilterResults (bv, [SimpleItem], None, Some("std2 > :val "), None, Some (values));
602
+ expect newItems. Failure?;
603
+ expect newItems. error == E ("The operation '>' cannot be used with a standard beacon.");
604
+ newItems := FilterResults (bv, [SimpleItem], None, Some("std2 <= :val "), None, Some (values));
605
+ expect newItems. Failure?;
606
+ expect newItems. error == E ("The operation '<=' cannot be used with a standard beacon.");
607
+ newItems := FilterResults (bv, [SimpleItem], None, Some("std2 >= :val "), None, Some (values));
608
+ expect newItems. Failure?;
609
+ expect newItems. error == E ("The operation '>=' cannot be used with a standard beacon.");
610
+ }
611
+
584
612
method {:test} TestComparisons () {
585
613
586
614
var values : DDB. ExpressionAttributeValueMap := map [
0 commit comments