fetch_ml/tests/fixtures/consistency/dataset_hash/expected_hashes.json
Jeremie Fraeys a239f3a14f
test(consistency): add dataset hash consistency test suite
Add cross-implementation consistency tests for dataset hash functionality:

## Test Fixtures
- Single file, nested directories, and multiple file test cases
- Expected hashes in JSON format for validation

## Test Infrastructure
- harness.go: Common test utilities and reference implementation runner
- dataset_hash_test.go: Consistency test cases comparing implementations
- cmd/update.go: Tool to regenerate expected hashes from reference

## Purpose
Ensures hash implementations (Go, C++, Zig) produce identical results
across all supported platforms and implementations.
2026-03-05 14:41:14 -05:00

48 lines
2 KiB
JSON

{
"version": "1.0.0",
"algorithm": "Dataset Hash Algorithm v1",
"description": "SHA256 of concatenated file hashes (sorted lexicographically)",
"fixtures": [
{
"id": "01_empty_dir",
"name": "Empty Directory",
"description": "Directory with no files",
"expected_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"files": []
},
{
"id": "02_single_file",
"name": "Single File",
"description": "Directory with one file containing 'hello world' (no trailing newline)",
"expected_hash": "6dd7e8e932ea9d58555d7fee44a9b01a9bd7448e986636b728ee3711b01f37ce",
"files": [
{
"path": "test.txt",
"content_hash": "a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447"
}
]
},
{
"id": "03_nested",
"name": "Nested Directories",
"description": "Multiple levels of subdirectories",
"expected_hash": "ba539800f8b98db5c7403773737ed92c71589e60b415d6a2556cb267a19fa0e0",
"files": [
{"path": "root.txt", "content_hash": "0c572ee02055d28c45d0616bc31484af3912fb14ff231f5fe23000fb6747f561"},
{"path": "subdir1/file1.txt", "content_hash": "89daac0d129ad5569989efcca1763e74de4431d1a3b081a68d53aa23e1cf2c3f"},
{"path": "subdir1/subdir2/deep.txt", "content_hash": "728312d971fd4d1aa9720531f0e495d33fda5c71562643fd814d0cff46689d4a"}
]
},
{
"id": "04_multiple_files",
"name": "Multiple Files",
"description": "Directory with several files at root level",
"expected_hash": "b2aca3c5daf9b5c46d96bfc78c4fb221c3b045798336c7c226937f10ac1257a5",
"files": [
{"path": "file_a.txt", "content_hash": "a2ba67db2bf4d822fc687c98c96db8e83284abd9f069a7e958aaae0e36490903"},
{"path": "file_b.txt", "content_hash": "0c0370cff9c241b6c1869edf309da41f6711e94cabf3d8d99044dc500189d15a"},
{"path": "file_c.txt", "content_hash": "e1f1e0b4750c7f7af8527ce285442cb45a337a7b83a97381430fd99587f79948"}
]
}
]
}