aboutsummaryrefslogtreecommitdiff
path: root/tests/tables-last.rs
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2017-11-12 17:26:09 -0800
committerDavid Tolnay <dtolnay@gmail.com>2017-11-12 19:33:11 -0800
commit3ad6e71f53a87215fb5286bcf87de15524699561 (patch)
treef9ac5154af7984a7c65b903869487c11baee3596 /tests/tables-last.rs
parent3b77b5fb6520c7bf13be6308978efa8a185d0c12 (diff)
downloadmilf-rs-3ad6e71f53a87215fb5286bcf87de15524699561.tar.gz
milf-rs-3ad6e71f53a87215fb5286bcf87de15524699561.zip
Move tests into their own crate
Diffstat (limited to 'tests/tables-last.rs')
-rw-r--r--tests/tables-last.rs30
1 files changed, 0 insertions, 30 deletions
diff --git a/tests/tables-last.rs b/tests/tables-last.rs
deleted file mode 100644
index d05c8f0..0000000
--- a/tests/tables-last.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-#[macro_use]
-extern crate serde_derive;
-extern crate toml;
-
-use std::collections::HashMap;
-
-#[derive(Serialize)]
-struct A {
- #[serde(serialize_with = "toml::ser::tables_last")]
- vals: HashMap<&'static str, Value>,
-}
-
-#[derive(Serialize)]
-#[serde(untagged)]
-enum Value {
- Map(HashMap<&'static str, &'static str>),
- Int(i32),
-}
-
-#[test]
-fn always_works() {
- let mut a = A { vals: HashMap::new() };
- a.vals.insert("foo", Value::Int(0));
-
- let mut sub = HashMap::new();
- sub.insert("foo", "bar");
- a.vals.insert("bar", Value::Map(sub));
-
- toml::to_string(&a).unwrap();
-}