Skip to content

Commit

Permalink
Add test to confirm fnn_unsuffixed does not emit exponent notation
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Nov 5, 2021
1 parent c5025f0 commit 1f98077
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/ui/proc-macro/auxiliary/api/parse.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore-tidy-linelength

use proc_macro::Literal;

pub fn test() {
Expand All @@ -12,6 +14,10 @@ fn test_display_literal() {
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");
assert_eq!(
Literal::f64_unsuffixed(1e100).to_string(),
"10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0",
);
}

fn test_parse_literal() {
Expand Down

0 comments on commit 1f98077

Please sign in to comment.