Skip to content

Commit 6a22f35

Browse files
committed
Add test documenting that whitespace is not a valid digit separator
More following the old choices of using `f64::from_str`
1 parent de1f85e commit 6a22f35

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/parse.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ mod tests {
220220
assert!(parse("a124GB").is_err());
221221
assert!(parse("1.3 42.0 B").is_err());
222222
assert!(parse("1.3 ... B").is_err());
223+
// The original implementation did not account for the possibility that users may
224+
// use whitespace to visually separate digits, thus treat it as an error
225+
assert!(parse("1 000 B").is_err());
223226
}
224227

225228
#[test]

0 commit comments

Comments
 (0)