mirror of
https://github.com/denoland/deno
synced 2024-08-24 18:47:06 +00:00
Add 005_more_imports.ts
And run check_output_test in order.
This commit is contained in:
parent
421358e7a9
commit
7fe656f4b9
11
tests/005_more_imports.ts
Normal file
11
tests/005_more_imports.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { returnsHi, returnsFoo2, printHello3 } from "./subdir/mod1.ts";
|
||||
|
||||
printHello3();
|
||||
|
||||
if (returnsHi() !== "Hi") {
|
||||
throw Error("Unexpected");
|
||||
}
|
||||
|
||||
if (returnsFoo2() !== "Foo") {
|
||||
throw Error("Unexpected");
|
||||
}
|
1
tests/005_more_imports.ts.out
Normal file
1
tests/005_more_imports.ts.out
Normal file
|
@ -0,0 +1 @@
|
|||
Hello
|
17
tests/subdir/mod1.ts
Normal file
17
tests/subdir/mod1.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { returnsFoo, printHello2 } from "./subdir2/mod2.ts";
|
||||
|
||||
export function returnsHi(): string {
|
||||
return "Hi";
|
||||
}
|
||||
|
||||
export function returnsFoo2(): string {
|
||||
return returnsFoo();
|
||||
}
|
||||
|
||||
export function printHello3(): void {
|
||||
printHello2();
|
||||
}
|
||||
|
||||
export function throwsError(): void {
|
||||
throw Error("exception from mod1");
|
||||
}
|
9
tests/subdir/subdir2/mod2.ts
Normal file
9
tests/subdir/subdir2/mod2.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import { printHello } from "../print_hello.ts";
|
||||
|
||||
export function returnsFoo(): string {
|
||||
return "Foo";
|
||||
}
|
||||
|
||||
export function printHello2(): void {
|
||||
printHello();
|
||||
}
|
|
@ -14,10 +14,10 @@ tests_path = os.path.join(root_path, "tests")
|
|||
|
||||
def check_output_test(deno_exe_filename):
|
||||
assert os.path.isfile(deno_exe_filename)
|
||||
outs = [
|
||||
outs = sorted([
|
||||
filename for filename in os.listdir(tests_path)
|
||||
if filename.endswith(".out")
|
||||
]
|
||||
])
|
||||
assert len(outs) > 1
|
||||
tests = [(os.path.splitext(filename)[0], filename) for filename in outs]
|
||||
for (script, out_filename) in tests:
|
||||
|
|
Loading…
Reference in a new issue