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 | |
parent | e7fc7d7151fbfea07f0738f61c1932023ad761da (diff) |
tests(cli): add test for improper unicode encoding (#8162)
and updates swc_ecma_codegen
Closes #8161
-rw-r--r-- | Cargo.lock | 4 | ||||
-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 |
4 files changed, 9 insertions, 2 deletions
diff --git a/Cargo.lock b/Cargo.lock index c56a9ca8f..89538f915 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2379,9 +2379,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.41.0" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c48486c086354a033f5e5c4a9dc730ad0e7596039dd4d92f70fe56fcfec4f26a" +checksum = "96e655391ee7b9e7e01fde2f64bfc1dbcf8b712510fc09edc6c00de52704e6a9" dependencies = [ "bitflags", "num-bigint", 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); +} |