use super::RULE;
#[test]
fn ignore_inside_try_block() {
RULE.assert_ignores("try { $list.0 }");
}
#[test]
fn ignore_inside_if_block() {
RULE.assert_ignores("if ($list | is-not-empty) { $list.0 }");
}
#[test]
fn ignore_cell_path_string_access() {
RULE.assert_ignores("$record.name");
}
#[test]
fn ignore_nested_string_access() {
RULE.assert_ignores("$record.user.name");
}
#[test]
fn ignore_string_after_validation() {
RULE.assert_ignores(
r#"
if ($data | is-not-empty) {
$data.status
}
"#,
);
}
#[test]
fn ignore_optional_numeric_access() {
RULE.assert_ignores("[].0?");
}
#[test]
fn ignore_optional_access_on_variable() {
RULE.assert_ignores("$list.0?");
}
#[test]
fn ignore_optional_access_nested() {
RULE.assert_ignores("$data.items.0?");
}