File tree Expand file tree Collapse file tree 2 files changed +61
-34
lines changed
test/unified-test-format/valid-fail Expand file tree Collapse file tree 2 files changed +61
-34
lines changed Original file line number Diff line number Diff line change 33
33
},
34
34
{
35
35
"_id" : 2 ,
36
+ "json" : " 1"
37
+ },
38
+ {
39
+ "_id" : 3 ,
40
+ "json" : " [ \" foo\" ]"
41
+ },
42
+ {
43
+ "_id" : 4 ,
36
44
"json" : " { \" x\" }"
37
45
}
38
46
]
119
127
]
120
128
},
121
129
{
122
- "description" : " matchAsDocument fails to decode Extended JSON " ,
130
+ "description" : " matchAsDocument expects JSON object but given scalar " ,
123
131
"operations" : [
124
132
{
125
133
"name" : " find" ,
135
143
"_id" : 2 ,
136
144
"json" : {
137
145
"$$matchAsDocument" : {
138
- "x" : 1
146
+ "$$matchAsRoot" : {}
147
+ }
148
+ }
149
+ }
150
+ ]
151
+ }
152
+ ]
153
+ },
154
+ {
155
+ "description" : " matchAsDocument expects JSON object but given array" ,
156
+ "operations" : [
157
+ {
158
+ "name" : " find" ,
159
+ "object" : " collection0" ,
160
+ "arguments" : {
161
+ "filter" : {
162
+ "_id" : 3
163
+ },
164
+ "limit" : 1
165
+ },
166
+ "expectResult" : [
167
+ {
168
+ "_id" : 3 ,
169
+ "json" : {
170
+ "$$matchAsDocument" : {
171
+ "$$matchAsRoot" : {}
172
+ }
173
+ }
174
+ }
175
+ ]
176
+ }
177
+ ]
178
+ },
179
+ {
180
+ "description" : " matchAsDocument fails to decode Extended JSON" ,
181
+ "operations" : [
182
+ {
183
+ "name" : " find" ,
184
+ "object" : " collection0" ,
185
+ "arguments" : {
186
+ "filter" : {
187
+ "_id" : 4
188
+ },
189
+ "limit" : 1
190
+ },
191
+ "expectResult" : [
192
+ {
193
+ "_id" : 4 ,
194
+ "json" : {
195
+ "$$matchAsDocument" : {
196
+ "$$matchAsRoot" : {}
139
197
}
140
198
}
141
199
}
Original file line number Diff line number Diff line change 33
33
"y" : 2 ,
34
34
"z" : 3
35
35
}
36
- },
37
- {
38
- "_id" : 2 ,
39
- "x" : " { \" x\" : 1, \" y\" : 2.0 }"
40
36
}
41
37
]
42
38
}
43
39
],
44
40
"tests" : [
45
41
{
46
- "description" : " matchAsRoot with nested document" ,
42
+ "description" : " matchAsRoot with nested document does not match " ,
47
43
"operations" : [
48
44
{
49
45
"name" : " find" ,
66
62
]
67
63
}
68
64
]
69
- },
70
- {
71
- "description" : " matchAsRoot with matchAsDocument" ,
72
- "operations" : [
73
- {
74
- "name" : " find" ,
75
- "object" : " collection0" ,
76
- "arguments" : {
77
- "filter" : {
78
- "_id" : 1
79
- },
80
- "limit" : 1
81
- },
82
- "expectResult" : [
83
- {
84
- "_id" : 2 ,
85
- "x" : {
86
- "$$matchAsDocument" : {
87
- "$$matchAsRoot" : {
88
- "x" : 1
89
- }
90
- }
91
- }
92
- }
93
- ]
94
- }
95
- ]
96
65
}
97
66
]
98
67
}
You can’t perform that action at this time.
0 commit comments