Skip to content
Myr

Change behavior for empty input

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by sharkdp · committed by David Peter · parent 3e217f4 · Browse files · 1 file+1 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−9 removed

  • other:+1 added−9 removed

1 file+1 added−9 removed

modified:src/hyperfine/internal.rs+1 added-9 removed
148 unmodified lines
149 assert_relative_eq!(2.5, annotated_results[2].relative_speed);150}151152pub fn tokenize<'a>(values: &'a str) -> Vec<String> {153 if values == "" {154 return vec![];155 }156153 let mut tokens = vec![];154 let mut buf = String::new();155156 let mut iter = values.chars();
24 unmodified lines
181 tokens182}183184#[test]189fn test_tokenize_empty() {190 assert!(tokenize("").is_empty());191}192193#[test]185fn test_tokenize_single_value() {186 assert_eq!(tokenize(r""), vec![""]);187 assert_eq!(tokenize(r"foo"), vec!["foo"]);188 assert_eq!(tokenize(r" "), vec![" "]);189 assert_eq!(tokenize(r"hello\, world!"), vec!["hello, world!"]);190 assert_eq!(tokenize(r"\,"), vec![","]);
21 unmodified lines