diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-08-06 09:28:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-06 09:28:37 +0200 |
commit | f1e393873a17571ada80c189fbedef020d89cdad (patch) | |
tree | 935044691733689fbae18879a8bb70bf15672d75 /tests/custom/04_modules/14_circular_imports | |
parent | e55965a3d170f60776ffa2d82b2711d9ea3a0211 (diff) | |
parent | b4a3f6828478f1d831ae11ee4d3dcd82b93407c8 (diff) |
Merge pull request #97 from jow-/module-import-export-fixes
Diffstat (limited to 'tests/custom/04_modules/14_circular_imports')
-rw-r--r-- | tests/custom/04_modules/14_circular_imports | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/custom/04_modules/14_circular_imports b/tests/custom/04_modules/14_circular_imports new file mode 100644 index 0000000..0b6070a --- /dev/null +++ b/tests/custom/04_modules/14_circular_imports @@ -0,0 +1,43 @@ +Circular imports are not possible and will lead to a compilation error. + +-- Testcase -- +import a_val from "./files/a.uc"; +-- End -- + +-- File a.uc -- +import b_val from "./b.uc"; +export default "a"; +-- End -- + +-- File b.uc -- +import a_val from "./a.uc"; +export default "b"; +-- End -- + +-- Args -- +-R +-- End -- + +-- Expect stderr -- +Syntax error: Unable to compile module './files/a.uc': + + | Syntax error: Unable to compile module './files/b.uc': + | + | | Syntax error: Circular dependency + | | In ./files/b.uc, line 1, byte 19: + | | + | | `import a_val from "./a.uc";` + | | Near here --------^ + | + | In ./files/a.uc, line 1, byte 27: + | + | `import b_val from "./b.uc";` + | Near here ----------------^ + +In [stdin], line 1, byte 33: + + `import a_val from "./files/a.uc";` + Near here ----------------------^ + + +-- End -- |