mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
Use Debug over Display to fix parse test
This commit is contained in:
parent
23c0ab0170
commit
44bb5d0645
1 changed files with 6 additions and 1 deletions
|
@ -488,7 +488,12 @@ mod test_parse {
|
|||
|
||||
#[quickcheck]
|
||||
fn all_f64_values_parse(num: f64) {
|
||||
assert_parses_to(num.to_string().as_str(), Float(num.to_string().as_str()));
|
||||
// These can potentially be whole numbers. `Display` omits the decimal point for those,
|
||||
// causing them to no longer be parsed as fractional numbers by Roc.
|
||||
// Using `Debug` instead of `Display` ensures they always have a decimal point.
|
||||
let float_string = format!("{:?}", num);
|
||||
|
||||
assert_parses_to(float_string.as_str(), Float(float_string.as_str()));
|
||||
}
|
||||
|
||||
// SINGLE QUOTE LITERAL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue