Skip to content

Commit

Permalink
chore: add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
shulaoda committed Dec 1, 2024
1 parent 919ddcf commit 59707a9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/oxlint/fixtures/issue_7566/.oxlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/**
1 change: 1 addition & 0 deletions apps/oxlint/fixtures/issue_7566/tests/function/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
123 == NaN;
1 change: 1 addition & 0 deletions apps/oxlint/fixtures/issue_7566/tests/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
123 == NaN;
15 changes: 15 additions & 0 deletions apps/oxlint/src/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,4 +777,19 @@ mod test {
]);
assert_eq!(result.number_of_files, 1);
}

// Issue: <https://github.com/oxc-project/oxc/pull/7566>
#[test]
fn ignore_path_with_relative_files() {
let args = &[
"--ignore-path",
"fixtures/issue_7566/.oxlintignore",
"fixtures/issue_7566/tests/main.js",
"fixtures/issue_7566/tests/function/main.js",
];
let result = test(args);
assert_eq!(result.number_of_files, 0);
assert_eq!(result.number_of_warnings, 0);
assert_eq!(result.number_of_errors, 0);
}
}

0 comments on commit 59707a9

Please sign in to comment.