-
-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
As of Jan 28 2025, kdl-rs fails the following test cases:
- Should pass
- https://github.com/kdl-org/kdl/blob/main/tests/test_cases/input/zero_space_before_slashdash_arg.kdl
- https://github.com/kdl-org/kdl/blob/main/tests/test_cases/input/zero_space_before_slashdash_children.kdl
- https://github.com/kdl-org/kdl/blob/main/tests/test_cases/input/zero_space_before_slashdash_prop.kdl
- Should fail
The "should pass" tests don't exist in this repo; they were added Jan 28 2025. The "should fail" tests do exist, but it doesn't look like they're actually checked in validate_res:
Lines 76 to 111 in 268f3a2
| fn validate_res( | |
| res: Result<KdlDocument, KdlError>, | |
| path: &Path, | |
| src: &str, | |
| ) -> Result<(), ComplianceDiagnostic> { | |
| let file_name = path.file_name().unwrap(); | |
| let expected_dir = path | |
| .parent() | |
| .unwrap() | |
| .parent() | |
| .unwrap() | |
| .join("expected_kdl"); | |
| let expected_path = expected_dir.join(file_name); | |
| let underscored = expected_dir.join(format!("_{}", PathBuf::from(file_name).display())); | |
| if expected_path.exists() { | |
| let doc = res.map_err(|e| ComplianceDiagnostic::KdlError(path.into(), e))?; | |
| let expected = normalize_line_endings(fs::read_to_string(&expected_path)?); | |
| let actual = stringify_to_expected(doc); | |
| if actual != expected { | |
| return Err(ComplianceDiagnostic::ExpectationMismatch { | |
| file: path.into(), | |
| original: src.into(), | |
| expected: expected.replace('\n', "\\n").replace(" ", "."), | |
| actual: actual.replace('\n', "\\n").replace(" ", "."), | |
| }); | |
| } | |
| } else if underscored.exists() { | |
| eprintln!( | |
| "skipped reserialization for {}", | |
| PathBuf::from(file_name).display() | |
| ); | |
| // } else { | |
| // res.map_err(|e| ComplianceDiagnostic::KdlError(path.into(), e))?; | |
| } | |
| Ok(()) | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels