mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-25 05:29:39 +00:00
tests: add test for invalid config (#55)
This commit is contained in:
parent
d68eee296e
commit
2ac62203d5
1 changed files with 18 additions and 0 deletions
|
@ -105,3 +105,21 @@ color="always""#,
|
|||
o 0000000000000000000000000000000000000000
|
||||
"###);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_invalid_config() {
|
||||
// Test that we get a reasonable error if the config is invalid (#55)
|
||||
let test_env = TestEnvironment::default();
|
||||
|
||||
std::fs::write(
|
||||
test_env.config_path(),
|
||||
"[section]key = value-missing-quotes",
|
||||
)
|
||||
.unwrap();
|
||||
let assert = test_env
|
||||
.jj_cmd(test_env.env_root(), &["init", "repo"])
|
||||
.assert()
|
||||
.failure();
|
||||
insta::assert_snapshot!(get_stdout_string(&assert), @"Invalid config: expected newline, found an identifier at line 1 column 10 in config.toml
|
||||
");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue