use super::RULE;
#[test]
fn ignores_bare_glob_patterns() {
let code = r#"ls *.txt"#;
RULE.assert_ignores(code);
}
#[test]
fn ignores_glob_in_non_glob_context() {
let code = r#"echo "*.txt""#;
RULE.assert_ignores(code);
}
#[test]
fn ignores_glob_in_print_command() {
let code = r#"print "file?.rs""#;
RULE.assert_ignores(code);
}
#[test]
fn ignores_string_without_glob_chars() {
let code = r#"ls "file.txt""#;
RULE.assert_ignores(code);
}
#[test]
fn ignores_bare_word_without_glob_chars() {
let code = r#"ls src/main.rs"#;
RULE.assert_ignores(code);
}
#[test]
fn ignores_string_interpolation_with_glob() {
let code = r#"ls $"*.txt""#;
RULE.assert_ignores(code);
}
#[test]
fn ignores_raw_string_with_glob() {
let code = r#"ls r#'*.txt'#"#;
RULE.assert_ignores(code);
}
#[test]
fn ignores_backtick_string() {
let code = r#"ls `*.txt`"#;
RULE.assert_ignores(code);
}
#[test]
fn ignores_glob_in_list_literal() {
let code = r#"let files = ["*.txt", "*.rs"]"#;
RULE.assert_ignores(code);
}
#[test]
fn ignores_glob_in_variable_assignment() {
let code = r#"let pattern = "*.txt""#;
RULE.assert_ignores(code);
}
#[test]
fn ignores_glob_in_custom_function_without_glob_param() {
let code = r#"
def my-func [path: string] {}
my-func "*.txt"
"#;
RULE.assert_ignores(code);
}
#[test]
fn ignores_glob_in_record_literal() {
let code = r#"let config = {pattern: "*.txt"}"#;
RULE.assert_ignores(code);
}
#[test]
fn ignores_glob_passed_to_string_param() {
let code = r#""test*.txt" | str contains "*""#;
RULE.assert_ignores(code);
}
#[test]
fn ignores_glob_command_with_quoted_pattern() {
let code = r#"glob "**/*.rs""#;
RULE.assert_ignores(code);
}