Merge pull request #299 from ehuss/fix-float-suffix
Fix float with invalid suffix.
This commit is contained in:
commit
b147fe3682
|
@ -1396,6 +1396,8 @@ impl<'a> Deserializer<'a> {
|
|||
return Err(self.error(start, ErrorKind::NumberInvalid));
|
||||
}
|
||||
exponent = Some(a);
|
||||
} else if !suffix.is_empty() {
|
||||
return Err(self.error(start, ErrorKind::NumberInvalid));
|
||||
}
|
||||
|
||||
let mut number = integral
|
||||
|
|
|
@ -38,6 +38,8 @@ test!(empty_table,
|
|||
include_str!("invalid/empty-table.toml"));
|
||||
test!(float_no_leading_zero,
|
||||
include_str!("invalid/float-no-leading-zero.toml"));
|
||||
test!(float_no_suffix,
|
||||
include_str!("invalid/float-no-suffix.toml"));
|
||||
test!(float_no_trailing_digits,
|
||||
include_str!("invalid/float-no-trailing-digits.toml"));
|
||||
test!(key_after_array,
|
||||
|
|
1
test-suite/tests/invalid/float-no-suffix.toml
Normal file
1
test-suite/tests/invalid/float-no-suffix.toml
Normal file
|
@ -0,0 +1 @@
|
|||
a = 1.2f
|
Loading…
Reference in a new issue