Skip to content

Commit 7732fe6

Browse files
committed
utils: Strengthen quoted testing
Verify we see exactly one token. Signed-off-by: Colin Walters <[email protected]>
1 parent 25c12b8 commit 7732fe6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

utils/src/path.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ mod tests {
8787
(r#"/path/"withquotes'"#, r#""/path/\"withquotes'""#),
8888
];
8989
for (v, quoted) in cases {
90-
assert_eq!(quoted, format!("{}", PathQuotedDisplay::new(&v)));
90+
let q = PathQuotedDisplay::new(&v).to_string();
91+
assert_eq!(quoted, q.as_str());
92+
// Also sanity check there's exactly one token
93+
let token = shlex::split(&q).unwrap();
94+
assert_eq!(1, token.len());
95+
assert_eq!(v, token[0]);
9196
}
9297
}
9398

0 commit comments

Comments
 (0)