|
1 | 1 | # test on a JavaScript regex which is not a valid python regex |
2 | | -# `--format-regex=default` should accept it |
3 | | -# `--format-regex=python` should reject it |
| 2 | +# `--regex-variant=default` should accept it |
| 3 | +# `--regex-variant=python` should reject it |
4 | 4 | # |
5 | 5 | # check these options against documents with invalid and valid python regexes to confirm |
6 | 6 | # that they are behaving as expected |
|
43 | 43 | ("--disable-formats", "regex"), |
44 | 44 | ("--format-regex", "default"), |
45 | 45 | ("--format-regex", "python"), |
| 46 | + ("--regex-variant", "python"), |
| 47 | + ("--regex-variant", "default"), |
| 48 | + ("--regex-variant", "default", "--format-regex", "python"), |
| 49 | + ("--regex-variant", "python", "--format-regex", "default"), |
46 | 50 | ] |
47 | 51 | ) |
48 | 52 | def regexopts(request): |
@@ -108,7 +112,10 @@ def test_regex_format_js_specific(run_line, tmp_path, regexopts): |
108 | 112 | doc = tmp_path / "doc.json" |
109 | 113 | doc.write_text(json.dumps(JS_REGEX_DOCUMENT)) |
110 | 114 |
|
111 | | - expect_ok = regexopts != ("--format-regex", "python") |
| 115 | + expect_ok = regexopts[:2] not in ( |
| 116 | + ("--format-regex", "python"), |
| 117 | + ("--regex-variant", "python"), |
| 118 | + ) |
112 | 119 |
|
113 | 120 | res = run_line( |
114 | 121 | [ |
|
0 commit comments