Add a unit tests that validates that all language configs are valid

pull/647/head
Wilfred Hughes 2024-02-15 08:47:58 +07:00
parent e70224bb22
commit bf047030d2
1 changed files with 11 additions and 0 deletions

@ -1803,6 +1803,8 @@ fn atom_from_cursor<'a>(
#[cfg(test)]
mod tests {
use strum::IntoEnumIterator as _;
use super::*;
/// Simple smoke test for tree-sitter parsing. Having a test also
@ -1847,4 +1849,13 @@ mod tests {
}
};
}
/// Ensure that we don't crash when loading any of the
/// configs. This can happen on bad highlighting/foo.scm files.
#[test]
fn test_configs_valid() {
for language in guess::Language::iter() {
from_language(language);
}
}
}