Skip to content

Commit 5d27055

Browse files
authored
include input values in snapshot for a smooth review (#28)
1 parent c05abde commit 5d27055

File tree

40 files changed

+322
-19
lines changed

40 files changed

+322
-19
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ thiserror = "1.0.40"
3030
build-binary = ["clap", "anyhow"]
3131

3232
[dev-dependencies]
33-
insta = { version = "1.29.0", features = ["glob"] }
33+
insta = { version = "1.29.0", features = ["glob", "serde"] }

tests/snapshots/test__from_fixtures@additional_properties__extend.json.snap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
additionalProperties: false
7+
rhs:
8+
additionalProperties: true
49
input_file: tests/fixtures/additional_properties/extend.json
510
---
611
[

tests/snapshots/test__from_fixtures@additional_properties__restrict.json.snap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
additionalProperties: true
7+
rhs:
8+
additionalProperties: false
49
input_file: tests/fixtures/additional_properties/restrict.json
510
---
611
[

tests/snapshots/test__from_fixtures@any_of__any_of_with_constraint_to_type_1.json.snap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
anyOf:
7+
- minimum: 1
8+
type: integer
9+
rhs:
10+
type:
11+
- integer
12+
- string
413
input_file: tests/fixtures/any_of/any_of_with_constraint_to_type_1.json
514
---
615
[

tests/snapshots/test__from_fixtures@any_of__any_of_with_constraint_to_type_2.json.snap

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
anyOf:
7+
- minimum: 1
8+
type: integer
9+
- minimum: 2
10+
type: integer
11+
rhs:
12+
minimum: 1
13+
type:
14+
- integer
15+
- string
416
input_file: tests/fixtures/any_of/any_of_with_constraint_to_type_2.json
517
---
618
[
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
anyOf:
7+
- type: array
8+
- type: string
9+
rhs:
10+
anyOf:
11+
- type: string
12+
- type: array
413
input_file: tests/fixtures/any_of/order_change.json
514
---
615
[]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
anyOf:
7+
- type: string
8+
rhs:
9+
type: string
410
input_file: tests/fixtures/any_of/to_equivalent_type.json
511
---
612
[]

tests/snapshots/test__from_fixtures@any_of__to_less_strict_type.json.snap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
anyOf:
7+
- type: integer
8+
rhs:
9+
type:
10+
- integer
11+
- string
412
input_file: tests/fixtures/any_of/to_less_strict_type.json
513
---
614
[

tests/snapshots/test__from_fixtures@any_of__to_more_strict_type.json.snap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
anyOf:
7+
- type: integer
8+
- type: string
9+
rhs:
10+
type: string
411
input_file: tests/fixtures/any_of/to_more_strict_type.json
512
---
613
[

tests/snapshots/test__from_fixtures@any_of__type_to_any_of_within_array.json.snap

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
definitions:
7+
Hello:
8+
type: number
9+
items:
10+
- const: start_unmerge
11+
- $ref: "#/definitions/Hello"
12+
type: array
13+
rhs:
14+
definitions:
15+
Hello:
16+
anyOf:
17+
- minimum: 1
18+
type: number
19+
items:
20+
- const: start_unmerge
21+
- $ref: "#/definitions/Hello"
22+
type: array
423
input_file: tests/fixtures/any_of/type_to_any_of_within_array.json
524
---
625
[
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
type: integer
7+
rhs:
8+
anyOf:
9+
- type: integer
410
input_file: tests/fixtures/any_of/type_to_equivalent_any_of.json
511
---
612
[]

tests/snapshots/test__from_fixtures@any_of__type_to_less_strict_any_of.json.snap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
minimum: 1
7+
type: integer
8+
rhs:
9+
anyOf:
10+
- type: integer
411
input_file: tests/fixtures/any_of/type_to_less_strict_any_of.json
512
---
613
[

tests/snapshots/test__from_fixtures@any_of__type_to_more_strict_any_of.json.snap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
type: integer
7+
rhs:
8+
anyOf:
9+
- type: integer
10+
- type: string
411
input_file: tests/fixtures/any_of/type_to_more_strict_any_of.json
512
---
613
[

tests/snapshots/test__from_fixtures@properties__add.json.snap

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
properties:
7+
hello:
8+
type: string
9+
type: object
10+
rhs:
11+
properties:
12+
hello:
13+
type: string
14+
world:
15+
type: string
16+
type: object
417
input_file: tests/fixtures/properties/add.json
518
---
619
[

tests/snapshots/test__from_fixtures@properties__add_property_in_array.json.snap

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
definitions:
7+
Hello:
8+
type: object
9+
items:
10+
- const: start_unmerge
11+
- $ref: "#/definitions/Hello"
12+
type: array
13+
rhs:
14+
definitions:
15+
Hello:
16+
properties:
17+
transaction_id:
18+
type: string
19+
type: object
20+
items:
21+
- const: start_unmerge
22+
- $ref: "#/definitions/Hello"
23+
type: array
424
input_file: tests/fixtures/properties/add_property_in_array.json
525
---
626
[

tests/snapshots/test__from_fixtures@properties__add_property_in_array_of_any_of.json.snap

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
anyOf:
7+
- items:
8+
- const: start_unmerge
9+
- type: object
10+
type: array
11+
rhs:
12+
anyOf:
13+
- items:
14+
- const: start_unmerge
15+
- properties:
16+
transaction_id:
17+
type: string
18+
type: object
19+
type: array
420
input_file: tests/fixtures/properties/add_property_in_array_of_any_of.json
521
---
622
[

tests/snapshots/test__from_fixtures@properties__change.json.snap

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
properties:
7+
hello:
8+
type: string
9+
type: object
10+
rhs:
11+
properties:
12+
hello:
13+
type: number
14+
type: object
415
input_file: tests/fixtures/properties/change.json
516
---
617
[

tests/snapshots/test__from_fixtures@properties__remove.json.snap

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
properties:
7+
hello:
8+
type: string
9+
world:
10+
type: string
11+
type: object
12+
rhs:
13+
properties:
14+
hello:
15+
type: string
16+
type: object
417
input_file: tests/fixtures/properties/remove.json
518
---
619
[

tests/snapshots/test__from_fixtures@properties__remove_property_while_allowing_additional_properties.json.snap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
additionalProperties: true
7+
properties:
8+
foobar:
9+
type: string
10+
type: object
11+
rhs:
12+
additionalProperties: true
13+
type: object
414
input_file: tests/fixtures/properties/remove_property_while_allowing_additional_properties.json
515
---
616
[

tests/snapshots/test__from_fixtures@range__add_maximum.json.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
type: number
7+
rhs:
8+
maximum: 1
9+
type: number
410
input_file: tests/fixtures/range/add_maximum.json
511
---
612
[

tests/snapshots/test__from_fixtures@range__add_minimum.json.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
type: number
7+
rhs:
8+
minimum: 1
9+
type: number
410
input_file: tests/fixtures/range/add_minimum.json
511
---
612
[

tests/snapshots/test__from_fixtures@range__add_minimum_in_array.json.snap

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
definitions:
7+
Hello:
8+
type: number
9+
items:
10+
- const: start_unmerge
11+
- $ref: "#/definitions/Hello"
12+
type: array
13+
rhs:
14+
definitions:
15+
Hello:
16+
minimum: 1
17+
type: number
18+
items:
19+
- const: start_unmerge
20+
- $ref: "#/definitions/Hello"
21+
type: array
422
input_file: tests/fixtures/range/add_minimum_in_array.json
523
---
624
[

tests/snapshots/test__from_fixtures@range__change_minimum.json.snap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
minimum: 1
7+
type: number
8+
rhs:
9+
minimum: 1.3
10+
type: number
411
input_file: tests/fixtures/range/change_minimum.json
512
---
613
[

tests/snapshots/test__from_fixtures@range__change_minimum_and_maximum.json.snap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
---
22
source: tests/test.rs
33
expression: diff
4+
info:
5+
lhs:
6+
maximum: 2
7+
minimum: 1
8+
type: number
9+
rhs:
10+
maximum: 2.5
11+
minimum: 1.5
12+
type: number
413
input_file: tests/fixtures/range/change_minimum_and_maximum.json
514
---
615
[

0 commit comments

Comments
 (0)