From 9aa593cd5d4024890e36af7842f1eb4b4c3bd544 Mon Sep 17 00:00:00 2001 From: Hajime-san <41257923+Hajime-san@users.noreply.github.com> Date: Tue, 28 May 2024 22:34:57 +0900 Subject: fix(cli/test): decoding percent-encoding(non-ASCII) file path correctly (#23200) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Summary This PR resolves about the issue. fixes #10810 And the formerly context is in the PR. #22582 Here is an expected behaviour example with this change. - 🦕.test.ts ```ts import { assertEquals } from "https://deno.land/std@0.215.0/assert/mod.ts"; Deno.test("example test", () => { assertEquals("🍋", "🦕"); }); ``` --- tests/integration/test_tests.rs | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'tests/integration') diff --git a/tests/integration/test_tests.rs b/tests/integration/test_tests.rs index fe9eb83c5..2f5a620e1 100644 --- a/tests/integration/test_tests.rs +++ b/tests/integration/test_tests.rs @@ -63,6 +63,49 @@ itest!(fail { output: "test/fail.out", }); +// GHA CI seems to have a problem with Emoji +// https://github.com/denoland/deno/pull/23200#issuecomment-2134032695 +#[test] +fn fail_with_contain_unicode_filename() { + let context = TestContextBuilder::new().use_temp_cwd().build(); + let temp_dir = context.temp_dir(); + temp_dir.write( + "fail_with_contain_unicode_filename🦕.ts", + "Deno.test(\"test 0\", () => { + throw new Error(); +}); + ", + ); + let output = context + .new_command() + .args("test fail_with_contain_unicode_filename🦕.ts") + .run(); + output.skip_output_check(); + output.assert_exit_code(1); + output.assert_matches_text( + "Check [WILDCARD]/fail_with_contain_unicode_filename🦕.ts +running 1 test from ./fail_with_contain_unicode_filename🦕.ts +test 0 ... FAILED ([WILDCARD]) + + ERRORS + +test 0 => ./fail_with_contain_unicode_filename🦕.ts:[WILDCARD] +error: Error + throw new Error(); + ^ + at [WILDCARD]/fail_with_contain_unicode_filename%F0%9F%A6%95.ts:[WILDCARD] + + FAILURES + +test 0 => ./fail_with_contain_unicode_filename🦕.ts:[WILDCARD] + +FAILED | 0 passed | 1 failed ([WILDCARD]) + +error: Test failed +", + ); +} + itest!(collect { args: "test --ignore=test/collect/ignore test/collect", exit_code: 0, -- cgit v1.2.3