Skip to content

Commit 483a7ae

Browse files
authored
test: add golden conformance suite with cross-format fixtures
* feat: add golden conformance test suite for format conversion and mappings Adds 14 golden-file tests that detect output drift across parsers, serializers, and the mapping evaluator: - 7 format conversion tests (JSON/CSV/YAML cross-product) - 4 mapping tests (rename, select, filter, complex pipeline) - 3 round-trip consistency tests (JSON↔YAML, JSON↔CSV, YAML↔CSV) Golden files can be updated with: UPDATE_GOLDEN=1 cargo test --test golden_conformance Fixes #82 * fix: normalize line endings in golden tests for Windows compatibility
1 parent 11f2aa9 commit 483a7ae

15 files changed

+470
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"id": 1,
4+
"name": "Alice",
5+
"email": "alice@example.com",
6+
"age": 30,
7+
"active": true
8+
},
9+
{
10+
"id": 2,
11+
"name": "Bob",
12+
"email": "bob@example.com",
13+
"age": 25,
14+
"active": false
15+
},
16+
{
17+
"id": 3,
18+
"name": "Charlie",
19+
"email": "charlie@example.com",
20+
"age": 35,
21+
"active": true
22+
}
23+
]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
- id: 1
2+
name: Alice
3+
email: alice@example.com
4+
age: 30
5+
active: true
6+
- id: 2
7+
name: Bob
8+
email: bob@example.com
9+
age: 25
10+
active: false
11+
- id: 3
12+
name: Charlie
13+
email: charlie@example.com
14+
age: 35
15+
active: true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"email_domain": "example.com"
3+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[
2+
{
3+
"id": 1,
4+
"name": "Alice",
5+
"email": "alice@example.com",
6+
"age": 30,
7+
"active": true
8+
},
9+
{
10+
"id": 3,
11+
"name": "Charlie",
12+
"email": "charlie@example.com",
13+
"age": 35,
14+
"active": true
15+
}
16+
]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"id": 1,
4+
"name": "Alice",
5+
"email": "alice@example.com",
6+
"age": 30,
7+
"active": true
8+
},
9+
{
10+
"id": 2,
11+
"name": "Bob",
12+
"email": "bob@example.com",
13+
"age": 25,
14+
"active": false
15+
},
16+
{
17+
"id": 3,
18+
"name": "Charlie",
19+
"email": "charlie@example.com",
20+
"age": 35,
21+
"active": true
22+
}
23+
]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"id": 1,
4+
"name": "Alice",
5+
"email": "alice@example.com",
6+
"age": 30,
7+
"active": true
8+
},
9+
{
10+
"id": 2,
11+
"name": "Bob",
12+
"email": "bob@example.com",
13+
"age": 25,
14+
"active": false
15+
},
16+
{
17+
"id": 3,
18+
"name": "Charlie",
19+
"email": "charlie@example.com",
20+
"age": 35,
21+
"active": true
22+
}
23+
]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
id,name,email,age,active
2+
1,Alice,alice@example.com,30,true
3+
2,Bob,bob@example.com,25,false
4+
3,Charlie,charlie@example.com,35,true
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"id": 1,
4+
"name": "Alice",
5+
"email": "alice@example.com",
6+
"age": 30,
7+
"active": true
8+
},
9+
{
10+
"id": 2,
11+
"name": "Bob",
12+
"email": "bob@example.com",
13+
"age": 25,
14+
"active": false
15+
},
16+
{
17+
"id": 3,
18+
"name": "Charlie",
19+
"email": "charlie@example.com",
20+
"age": 35,
21+
"active": true
22+
}
23+
]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
- id: 1
2+
name: Alice
3+
email: alice@example.com
4+
age: 30
5+
active: true
6+
- id: 2
7+
name: Bob
8+
email: bob@example.com
9+
age: 25
10+
active: false
11+
- id: 3
12+
name: Charlie
13+
email: charlie@example.com
14+
age: 35
15+
active: true
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
id,name,email,age,active
2+
1,Alice,alice@example.com,30,true
3+
2,Bob,bob@example.com,25,false
4+
3,Charlie,charlie@example.com,35,true

0 commit comments

Comments
 (0)