@@ -231,63 +231,70 @@ mod jq_tests {
231231 fn test_jq_identity ( ) {
232232 let input = json ! ( { "a" : 1 , "b" : 2 } ) ;
233233 let result = jq:: apply ( "." , & input) . unwrap ( ) ;
234- assert_eq ! ( result, input) ;
234+ assert_eq ! ( result, vec! [ input] ) ;
235235 }
236236
237237 #[ test]
238238 fn test_jq_field_access ( ) {
239239 let input = json ! ( { "name" : "test" , "value" : 42 } ) ;
240240 let result = jq:: apply ( ".name" , & input) . unwrap ( ) ;
241- assert_eq ! ( result, json!( "test" ) ) ;
241+ assert_eq ! ( result, vec! [ json!( "test" ) ] ) ;
242242 }
243243
244244 #[ test]
245245 fn test_jq_nested_access ( ) {
246246 let input = json ! ( { "a" : { "b" : { "c" : "deep" } } } ) ;
247247 let result = jq:: apply ( ".a.b.c" , & input) . unwrap ( ) ;
248- assert_eq ! ( result, json!( "deep" ) ) ;
248+ assert_eq ! ( result, vec! [ json!( "deep" ) ] ) ;
249249 }
250250
251251 #[ test]
252252 fn test_jq_array_index ( ) {
253253 let input = json ! ( { "items" : [ "a" , "b" , "c" ] } ) ;
254254 let result = jq:: apply ( ".items[0]" , & input) . unwrap ( ) ;
255- assert_eq ! ( result, json!( "a" ) ) ;
255+ assert_eq ! ( result, vec! [ json!( "a" ) ] ) ;
256256 }
257257
258258 #[ test]
259259 fn test_jq_array_slice ( ) {
260260 let input = json ! ( { "items" : [ 1 , 2 , 3 , 4 , 5 ] } ) ;
261261 let result = jq:: apply ( ".items[0:3]" , & input) . unwrap ( ) ;
262- assert_eq ! ( result, json!( [ 1 , 2 , 3 ] ) ) ;
262+ assert_eq ! ( result, vec! [ json!( [ 1 , 2 , 3 ] ) ] ) ;
263263 }
264264
265265 #[ test]
266266 fn test_jq_select_fields ( ) {
267267 let input = json ! ( { "name" : "test" , "age" : 30 , "extra" : true } ) ;
268268 let result = jq:: apply ( "{name, age}" , & input) . unwrap ( ) ;
269- assert_eq ! ( result, json!( { "name" : "test" , "age" : 30 } ) ) ;
269+ assert_eq ! ( result, vec! [ json!( { "name" : "test" , "age" : 30 } ) ] ) ;
270270 }
271271
272272 #[ test]
273273 fn test_jq_pipe ( ) {
274274 let input = json ! ( { "items" : [ { "name" : "a" } , { "name" : "b" } ] } ) ;
275275 let result = jq:: apply ( ".items | length" , & input) . unwrap ( ) ;
276- assert_eq ! ( result, json!( 2 ) ) ;
276+ assert_eq ! ( result, vec! [ json!( 2 ) ] ) ;
277277 }
278278
279279 #[ test]
280280 fn test_jq_map ( ) {
281281 let input = json ! ( { "items" : [ { "name" : "a" , "v" : 1 } , { "name" : "b" , "v" : 2 } ] } ) ;
282282 let result = jq:: apply ( "[.items[] | .name]" , & input) . unwrap ( ) ;
283- assert_eq ! ( result, json!( [ "a" , "b" ] ) ) ;
283+ assert_eq ! ( result, vec! [ json!( [ "a" , "b" ] ) ] ) ;
284284 }
285285
286286 #[ test]
287287 fn test_jq_null_on_missing ( ) {
288288 let input = json ! ( { "a" : 1 } ) ;
289289 let result = jq:: apply ( ".nonexistent" , & input) . unwrap ( ) ;
290- assert_eq ! ( result, json!( null) ) ;
290+ assert_eq ! ( result, vec![ json!( null) ] ) ;
291+ }
292+
293+ #[ test]
294+ fn test_jq_multiple_outputs ( ) {
295+ let input = json ! ( { "items" : [ { "name" : "a" } , { "name" : "b" } , { "name" : "c" } ] } ) ;
296+ let result = jq:: apply ( ".items[].name" , & input) . unwrap ( ) ;
297+ assert_eq ! ( result, vec![ json!( "a" ) , json!( "b" ) , json!( "c" ) ] ) ;
291298 }
292299
293300 #[ test]
0 commit comments