diff --git a/Cargo.toml b/Cargo.toml index 6525da2..e2ddf79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ clap = { version = "4.5.4", features = ["derive"] } csv = "1.3.0" serde = { version = "1.0.197", features = ["derive"] } tree-sitter = "0.22.5" -tree-sitter-tlaplus = "1.3.3" +tree-sitter-tlaplus = "1.3.6" [dev-dependencies] glob = "0.3.1" diff --git a/src/main.rs b/src/main.rs index 1d015a5..43f6cf3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -107,4 +107,20 @@ mod tests { let actual = std::fs::read_to_string(&output_path).unwrap(); assert_eq!(expected, actual); } + + #[test] + fn test_blank_input_file() { + let project_root = std::env::var("CARGO_MANIFEST_DIR").unwrap(); + let input_path = PathBuf::from(project_root) + .join("tests") + .join("BlankFile.tla"); + let output_path = input_path.clone(); + let result: Result<()> = convert( + input_path.as_path(), + output_path.as_path(), + tlauc::Mode::AsciiToUnicode, + false, + ); + assert!(result.is_err()); + } } diff --git a/tests/BlankFile.tla b/tests/BlankFile.tla new file mode 100644 index 0000000..e69de29