Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,6 @@ should_panic_without_expect = "allow" # 2
doc_markdown = "allow"
unused_self = "allow"
enum_glob_use = "allow"
needless_raw_string_hashes = "allow"
unreadable_literal = "allow"
unnested_or_patterns = "allow"
implicit_hasher = "allow"
Expand Down
14 changes: 7 additions & 7 deletions src/uucore/src/lib/features/fsext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ fn replace_special_chars(s: &[u8]) -> Vec<u8> {
// * \011 ASCII horizontal tab with a tab character,
// * ASCII backslash with an actual backslash character.
//
s.replace(r#"\040"#, " ")
.replace(r#"\011"#, " ")
.replace(r#"\134"#, r#"\"#)
s.replace(r"\040", " ")
.replace(r"\011", " ")
.replace(r"\134", r"\")
}

impl MountInfo {
Expand Down Expand Up @@ -1171,23 +1171,23 @@ mod tests {
fn test_mountinfo_dir_special_chars() {
let info = MountInfo::new(
LINUX_MOUNTINFO,
&br#"317 61 7:0 / /mnt/f\134\040\011oo rw,relatime shared:641 - ext4 /dev/loop0 rw"#
&br"317 61 7:0 / /mnt/f\134\040\011oo rw,relatime shared:641 - ext4 /dev/loop0 rw"
.split(|c| *c == b' ')
.collect::<Vec<_>>(),
)
.unwrap();

assert_eq!(info.mount_dir, r#"/mnt/f\ oo"#);
assert_eq!(info.mount_dir, r"/mnt/f\ oo");

let info = MountInfo::new(
LINUX_MTAB,
&br#"/dev/loop0 /mnt/f\134\040\011oo ext4 rw,relatime 0 0"#
&br"/dev/loop0 /mnt/f\134\040\011oo ext4 rw,relatime 0 0"
.split(|c| *c == b' ')
.collect::<Vec<_>>(),
)
.unwrap();

assert_eq!(info.mount_dir, r#"/mnt/f\ oo"#);
assert_eq!(info.mount_dir, r"/mnt/f\ oo");
}

#[test]
Expand Down
20 changes: 10 additions & 10 deletions src/uucore/src/lib/mods/locale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,35 +617,35 @@ mod tests {
let temp_dir = TempDir::new().expect("Failed to create temp directory");

// Create en-US.ftl
let en_content = r#"
let en_content = r"
greeting = Hello, world!
welcome = Welcome, { $name }!
count-items = You have { $count ->
[one] { $count } item
*[other] { $count } items
}
missing-in-other = This message only exists in English
"#;
";

// Create fr-FR.ftl
let fr_content = r#"
let fr_content = r"
greeting = Bonjour, le monde!
welcome = Bienvenue, { $name }!
count-items = Vous avez { $count ->
[one] { $count } élément
*[other] { $count } éléments
}
"#;
";

// Create ja-JP.ftl (Japanese)
let ja_content = r#"
let ja_content = r"
greeting = こんにちは、世界!
welcome = ようこそ、{ $name }さん!
count-items = { $count }個のアイテムがあります
"#;
";

// Create ar-SA.ftl (Arabic - Right-to-Left)
let ar_content = r#"
let ar_content = r"
greeting = أهلاً بالعالم!
welcome = أهلاً وسهلاً، { $name }!
count-items = لديك { $count ->
Expand All @@ -655,13 +655,13 @@ count-items = لديك { $count ->
[few] { $count } عناصر
*[other] { $count } عنصر
}
"#;
";

// Create es-ES.ftl with invalid syntax
let es_invalid_content = r#"
let es_invalid_content = r"
greeting = Hola, mundo!
invalid-syntax = This is { $missing
"#;
";

fs::write(temp_dir.path().join("en-US.ftl"), en_content)
.expect("Failed to write en-US.ftl");
Expand Down
8 changes: 4 additions & 4 deletions tests/by-util/test_sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2061,7 +2061,7 @@ fn debug_key_annotation_output(ts: &TestScenario) -> String {
output
}

const EXPECTED_DEBUG_KEY_ANNOTATION: &str = r#"1
const EXPECTED_DEBUG_KEY_ANNOTATION: &str = r"1
^ no match for key

^ no match for key
Expand Down Expand Up @@ -2281,9 +2281,9 @@ B>chr1
__
1 3
__
"#;
";

const EXPECTED_DEBUG_KEY_ANNOTATION_LOCALE: &str = r#" 1²---++3 1,234 Mi
const EXPECTED_DEBUG_KEY_ANNOTATION_LOCALE: &str = r" 1²---++3 1,234 Mi
_
_________
________________________
Expand All @@ -2302,7 +2302,7 @@ _____
_____
______
___________________
"#;
";

#[test]
fn test_color_environment_variables() {
Expand Down
Loading