diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-11-23 10:22:13 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-23 10:22:13 +1100 |
commit | fec7fdc691d02eeecb01fed51b4717abd4d79b6c (patch) | |
tree | e79c751bf17b9cd38a7d9ad4cf47c273318c7716 /cli | |
parent | e7fc7d7151fbfea07f0738f61c1932023ad761da (diff) |
tests(cli): add test for improper unicode encoding (#8162)
and updates swc_ecma_codegen
Closes #8161
Diffstat (limited to 'cli')
-rw-r--r-- | cli/module_graph.rs | 1 | ||||
-rw-r--r-- | cli/tests/bundle/file_tests-fixture15.ts | 3 | ||||
-rw-r--r-- | cli/tests/bundle/fixture15.out | 3 |
3 files changed, 7 insertions, 0 deletions
diff --git a/cli/module_graph.rs b/cli/module_graph.rs index d11dda1ca..2572feb10 100644 --- a/cli/module_graph.rs +++ b/cli/module_graph.rs @@ -1909,6 +1909,7 @@ pub mod tests { ("file:///tests/fixture12.ts", "fixture12.out"), ("file:///tests/fixture13.ts", "fixture13.out"), ("file:///tests/fixture14.ts", "fixture14.out"), + ("file:///tests/fixture15.ts", "fixture15.out"), ]; let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); let fixtures = c.join("tests/bundle"); diff --git a/cli/tests/bundle/file_tests-fixture15.ts b/cli/tests/bundle/file_tests-fixture15.ts new file mode 100644 index 000000000..c1dd3bc89 --- /dev/null +++ b/cli/tests/bundle/file_tests-fixture15.ts @@ -0,0 +1,3 @@ +export function getIndex(c: string): number { + return "\x00\r\n\x85\u2028\u2029".indexOf(c); +} diff --git a/cli/tests/bundle/fixture15.out b/cli/tests/bundle/fixture15.out new file mode 100644 index 000000000..b8e7cfc5e --- /dev/null +++ b/cli/tests/bundle/fixture15.out @@ -0,0 +1,3 @@ +export function getIndex(c) { + return "\x00\r\n\x85\u2028\u2029".indexOf(c); +} |