Skip to content

Commit 109fefb

Browse files
committed
tests updated for json format
1 parent 5b3aed3 commit 109fefb

14 files changed

+100
-32
lines changed

fixtures/file1.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"default": null,
2929
"type": "bas",
3030
"nest": {
31-
"bar": ""
31+
"bar": "",
32+
"foo": 0
3233
}
3334
}
3435
}

fixtures/file1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ group4:
2121
type: bas
2222
nest:
2323
bar: ''
24+
foo: 0

fixtures/file2.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"someKey": true,
3737
"type": "bar",
3838
"nest": {
39-
"bar": 0
39+
"bar": 0,
40+
"foo": null
4041
}
4142
}
4243
}

fixtures/file2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ group4:
2727
type: bar
2828
nest:
2929
bar: 0
30+
foo: null

fixtures/filesJSONRecursiveJSONContent.txt

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ File file1.json content:
3030
}
3131
},
3232
"group4": {
33-
"default": "null",
33+
"default": null,
3434
"type": "bas",
3535
"nest": {
36-
"bar": ""
36+
"bar": "",
37+
"foo": 0
3738
}
3839
}
3940
},
@@ -209,26 +210,28 @@ File file1.json content:
209210
"history": "group4",
210211
"fileKey": "group4",
211212
"fileContent": {
212-
"default": "null",
213+
"default": null,
213214
"type": "bas",
214215
"nest": {
215-
"bar": ""
216+
"bar": "",
217+
"foo": 0
216218
}
217219
},
218220
"output": {
219221
"default": {
220222
"level": 2,
221223
"history": "group4.default",
222224
"fileKey": "default",
223-
"fileContent": "null",
225+
"fileContent": null,
224226
"output": []
225227
},
226228
"nest": {
227229
"level": 2,
228230
"history": "group4.nest",
229231
"fileKey": "nest",
230232
"fileContent": {
231-
"bar": ""
233+
"bar": "",
234+
"foo": 0
232235
},
233236
"output": {
234237
"bar": {
@@ -237,6 +240,13 @@ File file1.json content:
237240
"fileKey": "bar",
238241
"fileContent": "",
239242
"output": []
243+
},
244+
"foo": {
245+
"level": 3,
246+
"history": "group4.nest.foo",
247+
"fileKey": "foo",
248+
"fileContent": 0,
249+
"output": []
240250
}
241251
}
242252
},
@@ -260,7 +270,7 @@ File file2.json content:
260270
"common": {
261271
"follow": "false",
262272
"setting1": "Value 1",
263-
"setting3": "null",
273+
"setting3": null,
264274
"setting4": "blah blah",
265275
"setting5": {
266276
"key5": "value5"
@@ -294,7 +304,8 @@ File file2.json content:
294304
"someKey": "true",
295305
"type": "bar",
296306
"nest": {
297-
"bar": 0
307+
"bar": 0,
308+
"foo": null
298309
}
299310
}
300311
},
@@ -306,7 +317,7 @@ File file2.json content:
306317
"fileContent": {
307318
"follow": "false",
308319
"setting1": "Value 1",
309-
"setting3": "null",
320+
"setting3": null,
310321
"setting4": "blah blah",
311322
"setting5": {
312323
"key5": "value5"
@@ -338,7 +349,7 @@ File file2.json content:
338349
"level": 2,
339350
"history": "common.setting3",
340351
"fileKey": "setting3",
341-
"fileContent": "null",
352+
"fileContent": null,
342353
"output": []
343354
},
344355
"setting4": {
@@ -525,7 +536,8 @@ File file2.json content:
525536
"someKey": "true",
526537
"type": "bar",
527538
"nest": {
528-
"bar": 0
539+
"bar": 0,
540+
"foo": null
529541
}
530542
},
531543
"output": {
@@ -541,7 +553,8 @@ File file2.json content:
541553
"history": "group4.nest",
542554
"fileKey": "nest",
543555
"fileContent": {
544-
"bar": 0
556+
"bar": 0,
557+
"foo": null
545558
},
546559
"output": {
547560
"bar": {
@@ -550,6 +563,13 @@ File file2.json content:
550563
"fileKey": "bar",
551564
"fileContent": 0,
552565
"output": []
566+
},
567+
"foo": {
568+
"level": 3,
569+
"history": "group4.nest.foo",
570+
"fileKey": "foo",
571+
"fileContent": null,
572+
"output": []
553573
}
554574
}
555575
},

fixtures/filesJSONRecursiveYAMLContent.txt

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ File file1.yaml content:
3030
}
3131
},
3232
"group4": {
33-
"default": "null",
33+
"default": null,
3434
"type": "bas",
3535
"nest": {
36-
"bar": ""
36+
"bar": "",
37+
"foo": 0
3738
}
3839
}
3940
},
@@ -209,26 +210,28 @@ File file1.yaml content:
209210
"history": "group4",
210211
"fileKey": "group4",
211212
"fileContent": {
212-
"default": "null",
213+
"default": null,
213214
"type": "bas",
214215
"nest": {
215-
"bar": ""
216+
"bar": "",
217+
"foo": 0
216218
}
217219
},
218220
"output": {
219221
"default": {
220222
"level": 2,
221223
"history": "group4.default",
222224
"fileKey": "default",
223-
"fileContent": "null",
225+
"fileContent": null,
224226
"output": []
225227
},
226228
"nest": {
227229
"level": 2,
228230
"history": "group4.nest",
229231
"fileKey": "nest",
230232
"fileContent": {
231-
"bar": ""
233+
"bar": "",
234+
"foo": 0
232235
},
233236
"output": {
234237
"bar": {
@@ -237,6 +240,13 @@ File file1.yaml content:
237240
"fileKey": "bar",
238241
"fileContent": "",
239242
"output": []
243+
},
244+
"foo": {
245+
"level": 3,
246+
"history": "group4.nest.foo",
247+
"fileKey": "foo",
248+
"fileContent": 0,
249+
"output": []
240250
}
241251
}
242252
},
@@ -260,7 +270,7 @@ File file2.yaml content:
260270
"common": {
261271
"follow": "false",
262272
"setting1": "Value 1",
263-
"setting3": "null",
273+
"setting3": null,
264274
"setting4": "blah blah",
265275
"setting5": {
266276
"key5": "value5"
@@ -294,7 +304,8 @@ File file2.yaml content:
294304
"someKey": "true",
295305
"type": "bar",
296306
"nest": {
297-
"bar": 0
307+
"bar": 0,
308+
"foo": null
298309
}
299310
}
300311
},
@@ -306,7 +317,7 @@ File file2.yaml content:
306317
"fileContent": {
307318
"follow": "false",
308319
"setting1": "Value 1",
309-
"setting3": "null",
320+
"setting3": null,
310321
"setting4": "blah blah",
311322
"setting5": {
312323
"key5": "value5"
@@ -338,7 +349,7 @@ File file2.yaml content:
338349
"level": 2,
339350
"history": "common.setting3",
340351
"fileKey": "setting3",
341-
"fileContent": "null",
352+
"fileContent": null,
342353
"output": []
343354
},
344355
"setting4": {
@@ -525,7 +536,8 @@ File file2.yaml content:
525536
"someKey": "true",
526537
"type": "bar",
527538
"nest": {
528-
"bar": 0
539+
"bar": 0,
540+
"foo": null
529541
}
530542
},
531543
"output": {
@@ -541,7 +553,8 @@ File file2.yaml content:
541553
"history": "group4.nest",
542554
"fileKey": "nest",
543555
"fileContent": {
544-
"bar": 0
556+
"bar": 0,
557+
"foo": null
545558
},
546559
"output": {
547560
"bar": {
@@ -550,6 +563,13 @@ File file2.yaml content:
550563
"fileKey": "bar",
551564
"fileContent": 0,
552565
"output": []
566+
},
567+
"foo": {
568+
"level": 3,
569+
"history": "group4.nest.foo",
570+
"fileKey": "foo",
571+
"fileContent": null,
572+
"output": []
553573
}
554574
}
555575
},

fixtures/filesPlainRecursiveJSONContent.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Property 'group2.abc' has value 12345
1212
Property 'group2.deep.id' has value 45
1313
Property 'group4.default' has value null
1414
Property 'group4.nest.bar' has value ''
15+
Property 'group4.nest.foo' has value 0
1516
Property 'group4.type' has value 'bas'
1617
File file2.json content:
1718
Property 'common.follow' has value false
@@ -30,5 +31,6 @@ Property 'group3.deep.id.number' has value 45
3031
Property 'group3.fee' has value 100500
3132
Property 'group4.default' has value ''
3233
Property 'group4.nest.bar' has value 0
34+
Property 'group4.nest.foo' has value null
3335
Property 'group4.someKey' has value true
3436
Property 'group4.type' has value 'bar'

fixtures/filesPlainRecursiveYAMLContent.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Property 'group2.abc' has value 12345
1212
Property 'group2.deep.id' has value 45
1313
Property 'group4.default' has value null
1414
Property 'group4.nest.bar' has value ''
15+
Property 'group4.nest.foo' has value 0
1516
Property 'group4.type' has value 'bas'
1617
File file2.yaml content:
1718
Property 'common.follow' has value false
@@ -30,5 +31,6 @@ Property 'group3.deep.id.number' has value 45
3031
Property 'group3.fee' has value 100500
3132
Property 'group4.default' has value ''
3233
Property 'group4.nest.bar' has value 0
34+
Property 'group4.nest.foo' has value null
3335
Property 'group4.someKey' has value true
3436
Property 'group4.type' has value 'bar'

fixtures/filesRecursiveJSONDiffs.json

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"file2Content": {
1515
"follow": "false",
1616
"setting1": "Value 1",
17-
"setting3": "null",
17+
"setting3": null,
1818
"setting4": "blah blah",
1919
"setting5": {
2020
"key5": "value5"
@@ -61,7 +61,7 @@
6161
},
6262
"setting3": {
6363
"file1Content": "true",
64-
"file2Content": "null",
64+
"file2Content": null,
6565
"level": 2,
6666
"status": "changed",
6767
"fileKey": "setting3",
@@ -376,7 +376,7 @@
376376
},
377377
"group4": {
378378
"file1Content": {
379-
"default": "null",
379+
"default": null,
380380
"type": "bas",
381381
"nest": {
382382
"bar": ""
@@ -396,7 +396,7 @@
396396
"history": "group4",
397397
"output": {
398398
"default": {
399-
"file1Content": "null",
399+
"file1Content": null,
400400
"file2Content": "",
401401
"level": 2,
402402
"status": "changed",
@@ -406,10 +406,12 @@
406406
},
407407
"nest": {
408408
"file1Content": {
409-
"bar": ""
409+
"bar": "",
410+
"foo": 0
410411
},
411412
"file2Content": {
412-
"bar": 0
413+
"bar": 0,
414+
"foo": null
413415
},
414416
"level": 2,
415417
"status": "changed",
@@ -424,6 +426,15 @@
424426
"fileKey": "bar",
425427
"history": "group4.nest.bar",
426428
"output": []
429+
},
430+
"foo": {
431+
"file1Content": 0,
432+
"file2Content": null,
433+
"level": 3,
434+
"status": "changed",
435+
"fileKey": "foo",
436+
"history": "group4.nest.foo",
437+
"output": []
427438
}
428439
}
429440
},

fixtures/filesRecursivePlainDiffs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ Property 'group2' was removed
1212
Property 'group3' was added with value: [complex value]
1313
Property 'group4.default' was updated. From null to ''
1414
Property 'group4.nest.bar' was updated. From '' to 0
15+
Property 'group4.nest.foo' was updated. From 0 to null
1516
Property 'group4.someKey' was added with value: true
1617
Property 'group4.type' was updated. From 'bas' to 'bar'

0 commit comments

Comments
 (0)