summaryrefslogtreecommitdiff
path: root/cli/tools/test
diff options
context:
space:
mode:
authorHajime-san <41257923+Hajime-san@users.noreply.github.com>2024-05-28 22:34:57 +0900
committerGitHub <noreply@github.com>2024-05-28 13:34:57 +0000
commit9aa593cd5d4024890e36af7842f1eb4b4c3bd544 (patch)
tree9852e27158ed856700f28095b1f763752001bc0e /cli/tools/test
parentdc5c799c398ef1c396ff765726b93b65a4f2996b (diff)
fix(cli/test): decoding percent-encoding(non-ASCII) file path correctly (#23200)
# 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("🍋", "🦕"); }); ```
Diffstat (limited to 'cli/tools/test')
-rw-r--r--cli/tools/test/fmt.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/tools/test/fmt.rs b/cli/tools/test/fmt.rs
index 77cc3d1ad..d66c72239 100644
--- a/cli/tools/test/fmt.rs
+++ b/cli/tools/test/fmt.rs
@@ -8,6 +8,8 @@ use phf::phf_map;
use std::borrow::Cow;
use std::ops::AddAssign;
+use crate::util::path::to_percent_decoded_str;
+
use super::*;
pub fn to_relative_path_or_remote_url(cwd: &Url, path_or_url: &str) -> String {
@@ -19,7 +21,7 @@ pub fn to_relative_path_or_remote_url(cwd: &Url, path_or_url: &str) -> String {
if !r.starts_with("../") {
r = format!("./{r}");
}
- return r;
+ return to_percent_decoded_str(&r);
}
}
path_or_url.to_string()