You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: prefer_regexp_test.rs
    path of file: ./repos/oxc/crates/oxc_linter/src/rules/unicorn
    
    the code of the file until where you have to start completion: use oxc_ast::{
    ast::{Argument, Expression, MemberExpression},
    AstKind,
};
use oxc_diagnostics::{
    miette::{self, Diagnostic},
    thiserror::Error,
};
use oxc_macros::declare_oxc_lint;
use oxc_span::Span;

use crate::{ast_util::outermost_paren_parent, context::LintContext, rule::Rule, AstNode};

#[derive(Debug, Error, Diagnostic)]
#[error("eslint-plugin-unicorn(prefer-regexp-test): Prefer RegExp#test() over String#match() and RegExp#exec()")]
#[diagnostic(
    severity(warning),
    help("RegExp#test() exclusively returns a boolean and theref
    
fn test() {
    use crate::tester::Tester;

    let pass = vec![
        r"const bar = !re.test(foo)",
        r"const matches = foo.match(re) || []",
        r"const matches = foo.match(re)",
        r"const matches = re.exec(foo)",
        r"while (foo = re.exec(bar)) {}",
        r"while ((foo = re.exec(bar))) {}",
        r"if (foo.notMatch(re)) {}",
        r"if (re.notExec(foo)) {}",
        r"if (foo.match) {}",
        r"if (re.exec) {}",
        r"if (foo[match](re)) {}",
        r"if (re[exec](foo)) {}",
        r#"if (foo["match"](re)) {}"#,
        r#"if (re["exec"](foo)) {}"#,
        r"if (match(re)) {}",
        r"if (exec(foo)) {}",
        r"if (foo.match()) {}",
        r"if (re.exec()) {}",
        r"if (foo.match(re, another)) {}",
        r"if (re.exec(foo, another)) {}",
        r"if (foo.match(...[regexp])) {}",
        r"if (re.exec(...[string])) {}",
        r"if (foo.match(1)) {}",
        r#"if (foo.match("1")) {}"#,
        r"if (foo.match(null)) {}",
        r"if (foo.match(1n)) {}",
        r"if (foo.match(true)) {}",
    ];

    let fail = vec![
        r"const re = /a/; const bar = !foo.match(re)",
        r"const re = /a/; const bar = Boolean(foo.match(re))",
        r"const re = /a/; if (foo.match(re)) {}",
        r"const re = /a/; const bar = foo.match(re) ? 1 : 2",
        r"const re = /a/; while (foo.match(re)) foo = foo.slice(1);",
        r"const re = /a/; do {foo = foo.slice(1)} while (foo.match(re));",
        r"const re = /a/; for (; foo.match(re); ) foo = foo.slice(1);",
        r"const re = /a/; const bar = !re.exec(foo)",
        r"const re = /a/; const bar = Boolean(re.exec(foo))",
        r"const re = /a/; if (re.exec(foo)) {}",
        r"const re = /a/; const bar = re.exec(foo) ? 1 : 2",
        r"const re = /a/; while (re.exec(foo)) foo = foo.slice(1);",
        r"const re = /a/; do {foo = foo.slice(1)} while (re.exec(foo));",
        r"const re = /a/; for (; re.exec(foo); ) foo = foo.slice(1);",
        r"const re = /a/; if ((0, foo).match(re)) {}",
        r"const re = /a/; if ((0, foo).match((re))) {}",
        r"const re = /a/; if ((foo).match(re)) {}",
        r"const re = /a/; if ((foo).match((re))) {}",
        r"if (foo.match(/re/)) {}",
        r"const re = /a/; if (foo.match(re)) {}",
        r"const bar = {bar: /a/}; if (foo.match(bar.baz)) {}",
        r"if (foo.match(bar.baz())) {}",
        r#"if (foo.match(new RegExp("re", "g"))) {}"#,
        r"if (foo.match(new SomeRegExp())) {}",
        r"if (foo.match(new SomeRegExp)) {}",
        r"if (foo.match(bar?.baz)) {}",
        r"if (foo.match(bar?.baz())) {}",
        r"if (foo.match(bar || baz)) {}",
        r"if ((foo).match(/re/)) {}",
        r"if ((foo).match(new SomeRegExp)) {}",
        r"if ((foo).match(bar?.baz)) {}",
        r"if ((foo).match(bar?.baz())) {}",
        r"const bar = false; const baz = /a/; if ((foo).match(bar || baz)) {}",
        r"const re = [/a/]; if (foo.match([re][0])) {}",
        r"if (foo.match(unknown)) {}",
        r"if (foo.match(/a/g));",
        r"if (foo.match(/a/y));",
        r"if (foo.match(/a/gy));",
        r"if (foo.match(/a/ig));",
        r#"if (foo.match(new RegExp("a", "g")));"#,
        r"if (/a/g.exec(foo));",
        r"if (/a/y.exec(foo));",
        r"if (/a/gy.exec(foo));",
        r"if (/a/yi.exec(foo));",
        r#"if (new RegExp("a", "g").exec(foo));"#,
        r#"if (new RegExp("a", "y").exec(foo));"#,
        r"!/a/u.exec(foo)",
        r"!/a/v.exec(foo)",
    ];

    Tester::new(PreferRegexpTest::NAME, pass, fail).test_and_snapshot();
}