mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-10-28 16:18:57 +00:00
Change behavior for empty input
This commit is contained in:
1 parent
3e217f4233
commit
954b62003f
1 file changed
+1
-9
@@ -150,10 +150,6 @@ fn test_compute_relative_speed() {
|
||||
}
|
||||
|
||||
pub fn tokenize<'a>(values: &'a str) -> Vec<String> {
|
||||
if values == "" {
|
||||
return vec![];
|
||||
}
|
||||
|
||||
let mut tokens = vec![];
|
||||
let mut buf = String::new();
|
||||
|
||||
@@ -185,13 +181,9 @@ pub fn tokenize<'a>(values: &'a str) -> Vec<String> {
|
||||
tokens
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tokenize_empty() {
|
||||
assert!(tokenize("").is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tokenize_single_value() {
|
||||
assert_eq!(tokenize(r""), vec![""]);
|
||||
assert_eq!(tokenize(r"foo"), vec!["foo"]);
|
||||
assert_eq!(tokenize(r" "), vec![" "]);
|
||||
assert_eq!(tokenize(r"hello\, world!"), vec!["hello, world!"]);
|
||||
|
||||
Reference in new issue
Block a user