Skip to content

Commit

Permalink
Add test documenting that whitespace is not a valid digit separator
Browse files Browse the repository at this point in the history
More following the old choices of using `f64::from_str`
  • Loading branch information
sholderbach committed Jan 22, 2025
1 parent de1f85e commit 6a22f35
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ mod tests {
assert!(parse("a124GB").is_err());
assert!(parse("1.3 42.0 B").is_err());
assert!(parse("1.3 ... B").is_err());
// The original implementation did not account for the possibility that users may
// use whitespace to visually separate digits, thus treat it as an error
assert!(parse("1 000 B").is_err());
}

#[test]
Expand Down

0 comments on commit 6a22f35

Please sign in to comment.