1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

Add 005_more_imports.ts

And run check_output_test in order.
This commit is contained in:
Ryan Dahl 2018-08-01 16:30:19 -04:00
parent 421358e7a9
commit 7fe656f4b9
5 changed files with 40 additions and 2 deletions

11
tests/005_more_imports.ts Normal file
View 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");
}

View file

@ -0,0 +1 @@
Hello

17
tests/subdir/mod1.ts Normal file
View 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");
}

View file

@ -0,0 +1,9 @@
import { printHello } from "../print_hello.ts";
export function returnsFoo(): string {
return "Foo";
}
export function printHello2(): void {
printHello();
}

View file

@ -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: