forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
64 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
js/flatbuffers.js | ||
tests/error_syntax.js | ||
tests/badly_formatted.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
console.log( | ||
"Hello World" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log("Hello World"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python | ||
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. | ||
import os | ||
import sys | ||
from util import mkdtemp, root_path, tests_path, run, green_ok | ||
import shutil | ||
|
||
|
||
def fmt_test(deno_exe): | ||
sys.stdout.write("fmt_test...") | ||
sys.stdout.flush() | ||
d = mkdtemp() | ||
try: | ||
fixed_filename = os.path.join(tests_path, "badly_formatted_fixed.js") | ||
src = os.path.join(tests_path, "badly_formatted.js") | ||
dst = os.path.join(d, "badly_formatted.js") | ||
shutil.copyfile(src, dst) | ||
# Set DENO_DIR to //js/ so we don't have to rely on an intenet | ||
# connection to download https://deno.land/x/std/prettier/main.ts | ||
deno_dir = os.path.join(root_path, "js") | ||
run([deno_exe, dst, "--fmt"], merge_env={"DENO_DIR": deno_dir}) | ||
with open(fixed_filename) as f: | ||
expected = f.read() | ||
with open(dst) as f: | ||
actual = f.read() | ||
assert expected == actual | ||
finally: | ||
shutil.rmtree(d) | ||
print green_ok() | ||
|
||
|
||
if __name__ == "__main__": | ||
fmt_test(sys.argv[1]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters