mirror of
https://github.com/containers/bootc.git
synced 2026-02-05 15:45:53 +01:00
utils: Strengthen quoted testing
Verify we see exactly one token. Signed-off-by: Colin Walters <walters@verbum.org>
This commit is contained in:
@@ -87,7 +87,12 @@ mod tests {
|
||||
(r#"/path/"withquotes'"#, r#""/path/\"withquotes'""#),
|
||||
];
|
||||
for (v, quoted) in cases {
|
||||
assert_eq!(quoted, format!("{}", PathQuotedDisplay::new(&v)));
|
||||
let q = PathQuotedDisplay::new(&v).to_string();
|
||||
assert_eq!(quoted, q.as_str());
|
||||
// Also sanity check there's exactly one token
|
||||
let token = shlex::split(&q).unwrap();
|
||||
assert_eq!(1, token.len());
|
||||
assert_eq!(v, token[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user