aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlan Du <alanhdu@gmail.com>2017-05-31 00:30:19 +0100
committerAlan Du <alanhdu@gmail.com>2017-05-31 00:30:58 +0100
commit2a6b365f7c931feb5e870d54c6d4a02e8aee75bf (patch)
tree5c7afb340d63606c0630118ffe1ef4d6d2ebba06 /tests
parent3322bcd086399a658253e119323f4b4c44aa91ff (diff)
downloadmilf-rs-2a6b365f7c931feb5e870d54c6d4a02e8aee75bf.tar.gz
milf-rs-2a6b365f7c931feb5e870d54c6d4a02e8aee75bf.zip
Error when trying to serialize invalid float
Diffstat (limited to 'tests')
-rw-r--r--tests/invalid-encoder-misc.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/invalid-encoder-misc.rs b/tests/invalid-encoder-misc.rs
new file mode 100644
index 0000000..272f58f
--- /dev/null
+++ b/tests/invalid-encoder-misc.rs
@@ -0,0 +1,14 @@
+extern crate toml;
+
+use std::f64;
+
+#[test]
+fn test_invalid_float_encode() {
+ fn bad(value: toml::Value) {
+ assert!(toml::to_string(&value).is_err());
+ }
+
+ bad(toml::Value::Float(f64::INFINITY));
+ bad(toml::Value::Float(f64::NEG_INFINITY));
+ bad(toml::Value::Float(f64::NAN));
+}