You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/test/resources/mongo-values.sk
+7-7
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ test "mongo-values":
15
15
assert mongo json of {_document} is "{""playerName"": ""Romitou"", ""coins"": 100, ""fruitList"": [""kiwi"", ""pear""], ""appleList"": []}" with "incorrect mongo list removal"
16
16
17
17
delete mongo value "coins" of {_document}
18
-
assert mongo json of {_document} is "{""playerName"": ""Romitou"", ""fruitList"": [""kiwi"", ""pear""], ""appleList"": [""apple""]}" with "incorrect mongo value deletion"
18
+
assert mongo json of {_document} is "{""playerName"": ""Romitou"", ""fruitList"": [""kiwi"", ""pear""], ""appleList"": []}" with "incorrect mongo value deletion"
19
19
20
20
add "banana" to mongo list "fruitList" of {_document}
21
21
assert mongo json of {_document} is "{""playerName"": ""Romitou"", ""fruitList"": [""kiwi"", ""pear"", ""banana""], ""appleList"": []}" with "incorrect mongo list addition"
@@ -28,27 +28,27 @@ test "mongo-values":
28
28
assert mongo json of {_document} is "{""playerName"": ""Romitou"", ""fruitList"": [""pear"", ""banana"", ""orange"", ""grape""], ""appleList"": []}" with "incorrect mongo list removal"
29
29
30
30
remove all {_fruits::*} from mongo list "fruitList" of {_document}
31
-
assert mongo json of {_document} is "{""playerName"": ""Romitou"", ""fruitList"": [""pear""], ""appleList"": []}" with "incorrect mongo list removal with list"
31
+
assert mongo json of {_document} is "{""playerName"": ""Romitou"", ""fruitList"": [""pear"", ""banana""], ""appleList"": []}" with "incorrect mongo list removal with list"
32
32
33
33
test "mongo-embedded-values":
34
34
set {_document} to mongo document
35
35
set mongo embedded value "stats.wins" of {_document} to 42
36
36
set mongo embedded value "stats.losses" of {_document} to 10
37
-
assert mongo json of {_document} is "{\"stats\":{\"wins\":42,\"losses\":10}}" with "incorrect embedded value definition"
37
+
assert mongo json of {_document} is "{""stats"":{""wins"":42,""losses"":10}}" with "incorrect embedded value definition"
38
38
39
39
delete mongo embedded value "stats.losses" of {_document}
40
-
assert mongo json of {_document} is "{\"stats\":{\"wins\":42}}" with "embedded value deletion failed"
40
+
assert mongo json of {_document} is "{""stats"":{""wins"":42}}" with "embedded value deletion failed"
41
41
42
42
set {_document} to mongo document
43
43
set mongo embedded value "inventory[0].name" of {_document} to "Sword"
44
44
set mongo embedded value "inventory[0].power" of {_document} to 5
45
45
set mongo embedded value "inventory[1].name" of {_document} to "Shield"
46
46
set mongo embedded value "inventory[1].defense" of {_document} to 12
47
-
assert mongo json of {_document} is "{\"inventory\":[{\"name\":\"Sword\",\"power\":5},{\"name\":\"Shield\",\"defense\":12}]}" with "incorrect nested array definition"
47
+
assert mongo json of {_document} is "{""inventory"":[{""name"":""Sword"",""power"":5},{""name"":""Shield"",""defense"":12}]}" with "incorrect nested array definition"
48
48
49
49
set mongo embedded value "inventory[1].defense" of {_document} to 15
50
-
assert mongo json of {_document} is "{\"inventory\":[{\"name\":\"Sword\",\"power\":5},{\"name\":\"Shield\",\"defense\":15}]}" with "embedded array element update failed"
50
+
assert mongo json of {_document} is "{""inventory"":[{""name"":""Sword"",""power"":5},{""name"":""Shield"",""defense"":15}]}" with "embedded array element update failed"
51
51
52
52
set {_document} to mongo document
53
53
set mongo embedded value "newList[2]" of {_document} to "filled"
54
-
assert mongo json of {_document} is "{\"newList\":[null,null,\"filled\"]}" with "list auto-fill failed"
54
+
assert mongo json of {_document} is "{""newList"":[null,null,""filled""]}" with "list auto-fill failed"
0 commit comments