Skip to content

Commit

Permalink
Add 005_more_imports.ts
Browse files Browse the repository at this point in the history
And run check_output_test in order.
  • Loading branch information
ry committed Aug 2, 2018
1 parent 421358e commit 7fe656f
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 2 deletions.
11 changes: 11 additions & 0 deletions tests/005_more_imports.ts
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions tests/005_more_imports.ts.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello
17 changes: 17 additions & 0 deletions tests/subdir/mod1.ts
Original file line number Diff line number Diff line change
@@ -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 changes: 9 additions & 0 deletions tests/subdir/subdir2/mod2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { printHello } from "../print_hello.ts";

export function returnsFoo(): string {
return "Foo";
}

export function printHello2(): void {
printHello();
}
4 changes: 2 additions & 2 deletions tools/check_output_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

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:
Expand Down

0 comments on commit 7fe656f

Please sign in to comment.