JavaScript: Update tests.

This commit is contained in:
Max Schaefer
2018-09-25 11:03:15 +01:00
parent 659c67c715
commit 0e63ea1b51
2 changed files with 20 additions and 0 deletions

View File

@@ -2,3 +2,11 @@
| tst.js:1:13:1:16 | "\\\\" | This replaces '\\' with itself. |
| tst.js:2:13:2:18 | /(\\\\)/ | This replaces '\\' with itself. |
| tst.js:3:13:3:17 | /["]/ | This replaces '"' with itself. |
| tst.js:6:13:6:18 | /foo/g | This replaces 'foo' with itself. |
| tst.js:9:13:9:17 | /^\\\\/ | This replaces '\\' with itself. |
| tst.js:10:13:10:17 | /\\\\$/ | This replaces '\\' with itself. |
| tst.js:11:13:11:18 | /\\b\\\\/ | This replaces '\\' with itself. |
| tst.js:12:13:12:18 | /\\B\\\\/ | This replaces '\\' with itself. |
| tst.js:13:13:13:22 | /\\\\(?!\\\\)/ | This replaces '\\' with itself. |
| tst.js:14:13:14:23 | /(?<!\\\\)\\\\/ | This replaces '\\' with itself. |
| tst.js:16:13:16:15 | /^/ | This replaces the empty string with itself. |

View File

@@ -2,3 +2,15 @@ raw.replace("\\", "\\"); // NOT OK
raw.replace(/(\\)/, "\\"); // NOT OK
raw.replace(/["]/, "\""); // NOT OK
raw.replace("\\", "\\\\"); // OK
raw.replace(/foo/g, 'foo'); // NOT OK
raw.replace(/foo/gi, 'foo'); // OK
raw.replace(/^\\/, "\\"); // NOT OK
raw.replace(/\\$/, "\\"); // NOT OK
raw.replace(/\b\\/, "\\"); // NOT OK
raw.replace(/\B\\/, "\\"); // NOT OK
raw.replace(/\\(?!\\)/, "\\"); // NOT OK
raw.replace(/(?<!\\)\\/, "\\"); // NOT OK
raw.replace(/^/, ""); // NOT OK