mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-05 15:32:49 +00:00
Adds a bunch of additional sample config toml files. Via the `datatest_runner`, these each correspond to a test case to check that the toml is correctly (in-)validated according to the schema. The `valid/*.toml` files typically define multiple related config options at once. Where there's some overlap with the default configs in `cli/src/config`, the aim was to choose different allowed values, e.g. hex colors, file size in bytes (numeric), etc. The `invalid/*.toml` files typically only define a single offending property such as to not obscure individual false negatives. All of the "invalid" files are still valid toml as the aim is not to test the `toml_edit` crate or Taplo. The sample files all contain a Taplo schema directive. This allows them to be validated against the schema on the fly by Taplo's LSP and derived IDE plugins to speed up editing and immediately highlight offending options. Closes #5695.
20 lines
492 B
Rust
20 lines
492 B
Rust
mod test_config_schema;
|
|
|
|
datatest_stable::harness! {
|
|
{
|
|
test = test_config_schema::taplo_check_config_valid,
|
|
root = "src/config",
|
|
pattern = r".*\.toml",
|
|
},
|
|
{
|
|
test = test_config_schema::taplo_check_config_valid,
|
|
root = "tests/sample-configs/valid",
|
|
pattern = r".*\.toml",
|
|
},
|
|
{
|
|
test = test_config_schema::taplo_check_config_invalid,
|
|
root = "tests/sample-configs/invalid",
|
|
pattern = r".*\.toml",
|
|
}
|
|
}
|