From 92b20c212fe5393d84af0145f6008cdcbd0cbc86 Mon Sep 17 00:00:00 2001 From: Sid Shankar Date: Tue, 10 Sep 2024 21:02:24 +0000 Subject: [PATCH] Tests for arbitrary ns export identifiers --- .../ql/test/library-tests/Modules/arbitrarySpecifier.ts | 3 ++- javascript/ql/test/library-tests/Modules/tests.expected | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/javascript/ql/test/library-tests/Modules/arbitrarySpecifier.ts b/javascript/ql/test/library-tests/Modules/arbitrarySpecifier.ts index 64f88bd1bed..8ed0bd8e804 100644 --- a/javascript/ql/test/library-tests/Modules/arbitrarySpecifier.ts +++ b/javascript/ql/test/library-tests/Modules/arbitrarySpecifier.ts @@ -2,4 +2,5 @@ import { "Foo::new" as Foo_new } from "./foo.wasm" const foo = Foo_new() -export { Foo_new as "Foo::new" } \ No newline at end of file +export { Foo_new as "Foo::new" } +export type * as "Foo_types" from './mod' \ No newline at end of file diff --git a/javascript/ql/test/library-tests/Modules/tests.expected b/javascript/ql/test/library-tests/Modules/tests.expected index 8ea0ff3daf5..00a9a564c19 100644 --- a/javascript/ql/test/library-tests/Modules/tests.expected +++ b/javascript/ql/test/library-tests/Modules/tests.expected @@ -4,6 +4,7 @@ test_ExportDeclarations | a.js:1:1:3:1 | export ... n 23;\\n} | | a.js:5:1:5:32 | export ... } = o; | | arbitrarySpecifier.ts:5:1:5:32 | export ... :new" } | +| arbitrarySpecifier.ts:6:1:6:42 | export ... ./mod'; | | b.js:5:1:5:18 | export { f as g }; | | b.js:7:1:7:21 | export ... './a'; | | d.js:4:1:4:20 | export * from 'm/c'; | @@ -80,7 +81,8 @@ test_Module_exports | a.js:1:1:5:32 | | default | a.js:1:16:3:1 | functio ... n 23;\\n} | | a.js:1:1:5:32 | | x | a.js:5:18:5:20 | f() | | a.js:1:1:5:32 | | y | a.js:5:25:5:25 | y | -| arbitrarySpecifier.ts:1:1:5:32 | | Foo::new | arbitrarySpecifier.ts:5:10:5:16 | Foo_new | +| arbitrarySpecifier.ts:1:1:6:42 | | Foo::new | arbitrarySpecifier.ts:5:10:5:16 | Foo_new | +| arbitrarySpecifier.ts:1:1:6:42 | | Foo_types | arbitrarySpecifier.ts:6:13:6:28 | * as "Foo_types" | | b.js:1:1:8:0 | | f2 | a.js:1:16:3:1 | functio ... n 23;\\n} | | b.js:1:1:8:0 | | g | b.js:5:10:5:10 | f | | e.js:1:1:4:0 | | g | a.js:1:16:3:1 | functio ... n 23;\\n} | @@ -106,6 +108,7 @@ test_OtherImports | import-indirect-path.js:1:1:1:25 | require ... + '/a') | a.js:1:1:5:32 | | | import-indirect-path.js:5:1:5:14 | require(x + y) | a.js:1:1:5:32 | | test_ReExportDeclarations +| arbitrarySpecifier.ts:6:1:6:42 | export ... ./mod'; | arbitrarySpecifier.ts:6:35:6:41 | './mod' | | b.js:7:1:7:21 | export ... './a'; | b.js:7:16:7:20 | './a' | | d.js:4:1:4:20 | export * from 'm/c'; | d.js:4:15:4:19 | 'm/c' | | e.js:3:1:3:35 | export ... './a'; | e.js:3:30:3:34 | './a' | @@ -124,6 +127,7 @@ test_getAnImportedModule | library-tests/Modules/reExportNamespaceClient.js | library-tests/Modules/reExportNamespace.js | test_getExportedName | arbitrarySpecifier.ts:5:10:5:30 | Foo_new ... o::new" | Foo::new | +| arbitrarySpecifier.ts:6:13:6:28 | * as "Foo_types" | Foo_types | | b.js:5:10:5:15 | f as g | g | | b.js:7:8:7:9 | f2 | f2 | | e.js:2:10:2:10 | x | x | @@ -160,6 +164,7 @@ test_getSourceNode | a.js:5:1:5:32 | export ... } = o; | x | a.js:5:18:5:20 | f() | | a.js:5:1:5:32 | export ... } = o; | y | a.js:5:25:5:25 | y | | arbitrarySpecifier.ts:5:1:5:32 | export ... :new" } | Foo::new | arbitrarySpecifier.ts:5:10:5:16 | Foo_new | +| arbitrarySpecifier.ts:6:1:6:42 | export ... ./mod'; | Foo_types | arbitrarySpecifier.ts:6:13:6:28 | * as "Foo_types" | | b.js:5:1:5:18 | export { f as g }; | g | b.js:5:10:5:10 | f | | b.js:7:1:7:21 | export ... './a'; | f2 | a.js:1:16:3:1 | functio ... n 23;\\n} | | e.js:2:1:2:16 | export { x, y }; | x | e.js:2:10:2:10 | x |