Skip to content

Commit e39eab6

Browse files
committed
✅ Fix test script
1 parent 0cea308 commit e39eab6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/test/resources/mongo-values.sk

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test "mongo-values":
1515
assert mongo json of {_document} is "{""playerName"": ""Romitou"", ""coins"": 100, ""fruitList"": [""kiwi"", ""pear""], ""appleList"": []}" with "incorrect mongo list removal"
1616

1717
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"
1919

2020
add "banana" to mongo list "fruitList" of {_document}
2121
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":
2828
assert mongo json of {_document} is "{""playerName"": ""Romitou"", ""fruitList"": [""pear"", ""banana"", ""orange"", ""grape""], ""appleList"": []}" with "incorrect mongo list removal"
2929

3030
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"
3232

3333
test "mongo-embedded-values":
3434
set {_document} to mongo document
3535
set mongo embedded value "stats.wins" of {_document} to 42
3636
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"
3838

3939
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"
4141

4242
set {_document} to mongo document
4343
set mongo embedded value "inventory[0].name" of {_document} to "Sword"
4444
set mongo embedded value "inventory[0].power" of {_document} to 5
4545
set mongo embedded value "inventory[1].name" of {_document} to "Shield"
4646
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"
4848

4949
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"
5151

5252
set {_document} to mongo document
5353
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

Comments
 (0)