diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2019-04-07 00:13:06 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-04-07 01:13:06 +0300 |
commit | 780e72ab6a092a6a7174c30bf4163857770d2ad0 (patch) | |
tree | 035bf5426c6c50f3cec4790700a29563c45db8b8 /tests | |
parent | cb11bbd8396fc3f6607481d50a4c82db0bfeffb7 (diff) |
Refactor CLI flag parsing (#2025)
Diffstat (limited to 'tests')
36 files changed, 47 insertions, 35 deletions
diff --git a/tests/001_hello.test b/tests/001_hello.test index 1e37d024d..121dbb2ea 100644 --- a/tests/001_hello.test +++ b/tests/001_hello.test @@ -1,2 +1,2 @@ -args: tests/001_hello.js --reload +args: --reload tests/001_hello.js output: tests/001_hello.js.out diff --git a/tests/002_hello.test b/tests/002_hello.test index 881271a97..d889acd00 100644 --- a/tests/002_hello.test +++ b/tests/002_hello.test @@ -1,2 +1,2 @@ -args: tests/002_hello.ts --reload +args: --reload tests/002_hello.ts output: tests/002_hello.ts.out diff --git a/tests/003_relative_import.test b/tests/003_relative_import.test index 42336ba22..5206c1aaa 100644 --- a/tests/003_relative_import.test +++ b/tests/003_relative_import.test @@ -1,2 +1,2 @@ -args: tests/003_relative_import.ts --reload +args: --reload tests/003_relative_import.ts output: tests/003_relative_import.ts.out diff --git a/tests/004_set_timeout.test b/tests/004_set_timeout.test index ea47ef1f3..6fda34f25 100644 --- a/tests/004_set_timeout.test +++ b/tests/004_set_timeout.test @@ -1,2 +1,2 @@ -args: tests/004_set_timeout.ts --reload +args: --reload tests/004_set_timeout.ts output: tests/004_set_timeout.ts.out diff --git a/tests/005_more_imports.test b/tests/005_more_imports.test index 998047a7b..fde5276fe 100644 --- a/tests/005_more_imports.test +++ b/tests/005_more_imports.test @@ -1,2 +1,2 @@ -args: tests/005_more_imports.ts --reload +args: --reload tests/005_more_imports.ts output: tests/005_more_imports.ts.out diff --git a/tests/006_url_imports.test b/tests/006_url_imports.test index c7210c83c..13c04219a 100644 --- a/tests/006_url_imports.test +++ b/tests/006_url_imports.test @@ -1,2 +1,2 @@ -args: tests/006_url_imports.ts --reload +args: --reload tests/006_url_imports.ts output: tests/006_url_imports.ts.out diff --git a/tests/010_set_interval.test b/tests/010_set_interval.test index f7c7a1f00..08ef3d36c 100644 --- a/tests/010_set_interval.test +++ b/tests/010_set_interval.test @@ -1,2 +1,2 @@ -args: tests/010_set_interval.ts --reload +args: --reload tests/010_set_interval.ts output: tests/010_set_interval.ts.out diff --git a/tests/012_async.test b/tests/012_async.test index 7bfe0a3c5..3694d7362 100644 --- a/tests/012_async.test +++ b/tests/012_async.test @@ -1,2 +1,2 @@ -args: tests/012_async.ts --reload +args: --reload tests/012_async.ts output: tests/012_async.ts.out diff --git a/tests/016_double_await.test b/tests/016_double_await.test index 35c028810..842d167cc 100644 --- a/tests/016_double_await.test +++ b/tests/016_double_await.test @@ -1,2 +1,2 @@ -args: tests/016_double_await.ts --allow-read --reload +args: --allow-read --reload tests/016_double_await.ts output: tests/016_double_await.ts.out diff --git a/tests/017_import_redirect.test b/tests/017_import_redirect.test index 4550a2f76..db7439f05 100644 --- a/tests/017_import_redirect.test +++ b/tests/017_import_redirect.test @@ -1,2 +1,2 @@ -args: tests/017_import_redirect.ts --reload +args: --reload tests/017_import_redirect.ts output: tests/017_import_redirect.ts.out diff --git a/tests/018_async_catch.test b/tests/018_async_catch.test index 582ff2b35..08961916d 100644 --- a/tests/018_async_catch.test +++ b/tests/018_async_catch.test @@ -1,2 +1,2 @@ -args: tests/018_async_catch.ts --reload +args: --reload tests/018_async_catch.ts output: tests/018_async_catch.ts.out diff --git a/tests/019_media_types.test b/tests/019_media_types.test index 28b14e641..c0fea5bc6 100644 --- a/tests/019_media_types.test +++ b/tests/019_media_types.test @@ -1,2 +1,2 @@ -args: tests/019_media_types.ts --reload +args: --reload tests/019_media_types.ts output: tests/019_media_types.ts.out diff --git a/tests/020_json_modules.test b/tests/020_json_modules.test index d9e9467fa..cacd21da0 100644 --- a/tests/020_json_modules.test +++ b/tests/020_json_modules.test @@ -1,2 +1,2 @@ -args: tests/020_json_modules.ts --reload +args: --reload tests/020_json_modules.ts output: tests/020_json_modules.ts.out diff --git a/tests/022_info_flag.test b/tests/022_info_flag.test index 2de27bdfa..e58288ec5 100644 --- a/tests/022_info_flag.test +++ b/tests/022_info_flag.test @@ -1,4 +1,4 @@ # The output assumes 003_relative_import.ts has already been run earlier # and its output is cached to $DENO_DIR. -args: --info http://127.0.0.1:4545/tests/019_media_types.ts +args: info http://127.0.0.1:4545/tests/019_media_types.ts output: tests/022_info_flag.out diff --git a/tests/023_no_ext_with_headers.test b/tests/023_no_ext_with_headers.test index 5be189af0..b663f174c 100644 --- a/tests/023_no_ext_with_headers.test +++ b/tests/023_no_ext_with_headers.test @@ -1,2 +1,2 @@ -args: tests/023_no_ext_with_headers --reload +args: --reload tests/023_no_ext_with_headers output: tests/023_no_ext_with_headers.out diff --git a/tests/024_import_no_ext_with_headers.test b/tests/024_import_no_ext_with_headers.test index 572158f12..efaca96c3 100644 --- a/tests/024_import_no_ext_with_headers.test +++ b/tests/024_import_no_ext_with_headers.test @@ -1,2 +1,2 @@ -args: tests/024_import_no_ext_with_headers.ts --reload +args: --reload tests/024_import_no_ext_with_headers.ts output: tests/024_import_no_ext_with_headers.ts.out diff --git a/tests/025_reload_js_type_error.test b/tests/025_reload_js_type_error.test index de8c6e51d..a2cd214be 100644 --- a/tests/025_reload_js_type_error.test +++ b/tests/025_reload_js_type_error.test @@ -1,2 +1,2 @@ -args: tests/025_reload_js_type_error.js --reload +args: --reload tests/025_reload_js_type_error.js output: tests/025_reload_js_type_error.js.out diff --git a/tests/026_redirect_javascript.js.test b/tests/026_redirect_javascript.js.test index a66cb0ea0..81d0ad038 100644 --- a/tests/026_redirect_javascript.js.test +++ b/tests/026_redirect_javascript.js.test @@ -1,2 +1,2 @@ -args: tests/026_redirect_javascript.js --reload +args: --reload tests/026_redirect_javascript.js output: tests/026_redirect_javascript.js.out diff --git a/tests/026_workers.test b/tests/026_workers.test index 1c5b6f4e6..5019a9256 100644 --- a/tests/026_workers.test +++ b/tests/026_workers.test @@ -1,2 +1,2 @@ -args: tests/026_workers.ts --reload -output: tests/026_workers.ts.out
\ No newline at end of file +args: --reload tests/026_workers.ts +output: tests/026_workers.ts.out diff --git a/tests/027_redirect_typescript.ts.test b/tests/027_redirect_typescript.ts.test index 8abfbc616..8762e61f2 100644 --- a/tests/027_redirect_typescript.ts.test +++ b/tests/027_redirect_typescript.ts.test @@ -1,2 +1,2 @@ -args: tests/027_redirect_typescript.ts --reload -output: tests/027_redirect_typescript.ts.out
\ No newline at end of file +args: --reload tests/027_redirect_typescript.ts +output: tests/027_redirect_typescript.ts.out diff --git a/tests/028_args.test b/tests/028_args.test new file mode 100644 index 000000000..df3c56205 --- /dev/null +++ b/tests/028_args.test @@ -0,0 +1,2 @@ +args: --reload tests/028_args.ts --arg1 val1 --arg2=val2 -- arg3 arg4 +output: tests/028_args.ts.out diff --git a/tests/028_args.ts b/tests/028_args.ts new file mode 100644 index 000000000..15df61555 --- /dev/null +++ b/tests/028_args.ts @@ -0,0 +1,3 @@ +Deno.args.forEach(arg => { + console.log(arg); +}); diff --git a/tests/028_args.ts.out b/tests/028_args.ts.out new file mode 100644 index 000000000..003599c0d --- /dev/null +++ b/tests/028_args.ts.out @@ -0,0 +1,7 @@ +tests/028_args.ts +--arg1 +val1 +--arg2=val2 +-- +arg3 +arg4 diff --git a/tests/async_error.test b/tests/async_error.test index 4667f6e09..8ebbfb56c 100644 --- a/tests/async_error.test +++ b/tests/async_error.test @@ -1,4 +1,4 @@ exit_code: 1 -args: tests/async_error.ts --reload +args: --reload tests/async_error.ts check_stderr: true output: tests/async_error.ts.out diff --git a/tests/error_001.test b/tests/error_001.test index 354f536d5..ca0a2ef2e 100644 --- a/tests/error_001.test +++ b/tests/error_001.test @@ -1,4 +1,4 @@ -args: tests/error_001.ts --reload +args: --reload tests/error_001.ts check_stderr: true exit_code: 1 output: tests/error_001.ts.out diff --git a/tests/error_002.test b/tests/error_002.test index e8658ad96..12f6e3cec 100644 --- a/tests/error_002.test +++ b/tests/error_002.test @@ -1,4 +1,4 @@ -args: tests/error_002.ts --reload +args: --reload tests/error_002.ts check_stderr: true exit_code: 1 output: tests/error_002.ts.out diff --git a/tests/error_003_typescript.test b/tests/error_003_typescript.test index cacce54cc..7a9d4a8ea 100644 --- a/tests/error_003_typescript.test +++ b/tests/error_003_typescript.test @@ -1,3 +1,3 @@ -args: tests/error_003_typescript.ts --reload +args: --reload tests/error_003_typescript.ts exit_code: 1 output: tests/error_003_typescript.ts.out diff --git a/tests/error_007_any.test b/tests/error_007_any.test index 970049195..fc0480796 100644 --- a/tests/error_007_any.test +++ b/tests/error_007_any.test @@ -1,4 +1,4 @@ -args: tests/error_007_any.ts --reload +args: --reload tests/error_007_any.ts check_stderr: true exit_code: 1 output: tests/error_007_any.ts.out diff --git a/tests/error_008_checkjs.test b/tests/error_008_checkjs.test index 0e43421e4..1944f0bca 100644 --- a/tests/error_008_checkjs.test +++ b/tests/error_008_checkjs.test @@ -1,4 +1,4 @@ -args: tests/error_008_checkjs.js --reload +args: --reload tests/error_008_checkjs.js check_stderr: true exit_code: 1 output: tests/error_008_checkjs.js.out diff --git a/tests/error_syntax.test b/tests/error_syntax.test index 297711bfa..e83cd030f 100644 --- a/tests/error_syntax.test +++ b/tests/error_syntax.test @@ -1,4 +1,4 @@ -args: tests/error_syntax.js --reload +args: --reload tests/error_syntax.js check_stderr: true exit_code: 1 output: tests/error_syntax.js.out diff --git a/tests/exit_error42.test b/tests/exit_error42.test index 59e4cd3d2..21a339a5e 100644 --- a/tests/exit_error42.test +++ b/tests/exit_error42.test @@ -1,3 +1,3 @@ exit_code: 42 -args: tests/exit_error42.ts --reload +args: --reload tests/exit_error42.ts output: tests/exit_error42.ts.out diff --git a/tests/https_import.test b/tests/https_import.test index e308466be..6cfb53058 100644 --- a/tests/https_import.test +++ b/tests/https_import.test @@ -1,2 +1,2 @@ -args: tests/https_import.ts --reload +args: --reload tests/https_import.ts output: tests/https_import.ts.out diff --git a/tests/if_main.test b/tests/if_main.test index 5830d00f8..fe4f061a6 100644 --- a/tests/if_main.test +++ b/tests/if_main.test @@ -1,2 +1,2 @@ -args: tests/if_main.ts --reload +args: --reload tests/if_main.ts output: tests/if_main.ts.out diff --git a/tests/import_meta.test b/tests/import_meta.test index 6767cfbb2..bfef5cb56 100644 --- a/tests/import_meta.test +++ b/tests/import_meta.test @@ -1,2 +1,2 @@ -args: tests/import_meta.ts --reload +args: --reload tests/import_meta.ts output: tests/import_meta.ts.out diff --git a/tests/unbuffered_stderr.test b/tests/unbuffered_stderr.test index 0e4109c7f..b3909dc2d 100644 --- a/tests/unbuffered_stderr.test +++ b/tests/unbuffered_stderr.test @@ -1,3 +1,3 @@ -args: tests/unbuffered_stderr.ts --reload +args: --reload tests/unbuffered_stderr.ts check_stderr: true output: tests/unbuffered_stderr.ts.out diff --git a/tests/unbuffered_stdout.test b/tests/unbuffered_stdout.test index d0476b3ac..3ed399cb8 100644 --- a/tests/unbuffered_stdout.test +++ b/tests/unbuffered_stdout.test @@ -1,2 +1,2 @@ -args: tests/unbuffered_stdout.ts --reload +args: --reload tests/unbuffered_stdout.ts output: tests/unbuffered_stdout.ts.out |