diff options
author | Luca Matei Pintilie <lucafulger@gmail.com> | 2022-10-18 15:33:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-18 15:33:35 +0200 |
commit | 1a0c7edebacc76a70e57dfd494e24420fa77b56b (patch) | |
tree | afa26f8db4dd121f548e19f92f84c1da589708c4 /cli/tests/integration/run_tests.rs | |
parent | 23bb0abc230bd796e60bb8e22ccc39aef5629158 (diff) |
feat: introduce navigator.language (#12322)
Link to the spec:
https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-language-dev
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/tests/integration/run_tests.rs')
-rw-r--r-- | cli/tests/integration/run_tests.rs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 004acb469..156940185 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -2377,6 +2377,59 @@ itest!(eval_context_throw_dom_exception { output: "run/eval_context_throw_dom_exception.js.out", }); +#[test] +#[cfg(unix)] +fn navigator_language_unix() { + let (res, _) = util::run_and_collect_output( + true, + "run navigator_language.ts", + None, + Some(vec![("LC_ALL".to_owned(), "pl_PL".to_owned())]), + false, + ); + assert_eq!(res, "pl-PL\n") +} + +#[test] +fn navigator_language() { + let (res, _) = util::run_and_collect_output( + true, + "run navigator_language.ts", + None, + None, + false, + ); + assert!(!res.is_empty()) +} + +#[test] +#[cfg(unix)] +fn navigator_languages_unix() { + let (res, _) = util::run_and_collect_output( + true, + "run navigator_languages.ts", + None, + Some(vec![ + ("LC_ALL".to_owned(), "pl_PL".to_owned()), + ("NO_COLOR".to_owned(), "1".to_owned()), + ]), + false, + ); + assert_eq!(res, "[ \"pl-PL\" ]\n") +} + +#[test] +fn navigator_languages() { + let (res, _) = util::run_and_collect_output( + true, + "run navigator_languages.ts", + None, + None, + false, + ); + assert!(!res.is_empty()) +} + /// Regression test for https://github.com/denoland/deno/issues/12740. #[test] fn issue12740() { |