Append .0 to unsuffixed float if it would otherwise become int token
This commit is contained in:
parent
ffba430924
commit
c5025f0e4e
2 changed files with 14 additions and 2 deletions
|
|
@ -8,6 +8,10 @@ pub fn test() {
|
|||
fn test_display_literal() {
|
||||
assert_eq!(Literal::isize_unsuffixed(-10).to_string(), "-10");
|
||||
assert_eq!(Literal::isize_suffixed(-10).to_string(), "-10isize");
|
||||
assert_eq!(Literal::f32_unsuffixed(-10.0).to_string(), "-10.0");
|
||||
assert_eq!(Literal::f32_suffixed(-10.0).to_string(), "-10f32");
|
||||
assert_eq!(Literal::f64_unsuffixed(-10.0).to_string(), "-10.0");
|
||||
assert_eq!(Literal::f64_suffixed(-10.0).to_string(), "-10f64");
|
||||
}
|
||||
|
||||
fn test_parse_literal() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue