aboutsummaryrefslogtreecommitdiff
path: root/test-suite/tests
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2019-01-08 15:24:40 -0800
committerGitHub <noreply@github.com>2019-01-08 15:24:40 -0800
commit56f9afb4d2abdf38ed3caf9f819ac8bacc290940 (patch)
tree8b982602f331d2c1df97121b2f2b971dc39bc68d /test-suite/tests
parentd0977ab1dd9720c572b2d54a51196fcdf38f7544 (diff)
parent0372ba6925aa2c6db4d27022562064e25cdc5312 (diff)
downloadmilf-rs-56f9afb4d2abdf38ed3caf9f819ac8bacc290940.tar.gz
milf-rs-56f9afb4d2abdf38ed3caf9f819ac8bacc290940.zip
Merge pull request #278 from Kerollmops/master
Add the preserve_order feature (rebased version)
Diffstat (limited to 'test-suite/tests')
-rw-r--r--test-suite/tests/display.rs5
-rw-r--r--test-suite/tests/serde.rs7
2 files changed, 6 insertions, 6 deletions
diff --git a/test-suite/tests/display.rs b/test-suite/tests/display.rs
index ca4fdd8..0174de1 100644
--- a/test-suite/tests/display.rs
+++ b/test-suite/tests/display.rs
@@ -1,11 +1,10 @@
extern crate toml;
-use std::collections::BTreeMap;
-
use toml::Value::{String, Integer, Float, Boolean, Array, Table};
+use toml::map::Map;
macro_rules! map( ($($k:expr => $v:expr),*) => ({
- let mut _m = BTreeMap::new();
+ let mut _m = Map::new();
$(_m.insert($k.to_string(), $v);)*
_m
}) );
diff --git a/test-suite/tests/serde.rs b/test-suite/tests/serde.rs
index c1b6d78..9bbf7e0 100644
--- a/test-suite/tests/serde.rs
+++ b/test-suite/tests/serde.rs
@@ -9,6 +9,7 @@ use serde::{Deserialize, Deserializer};
use toml::Value;
use toml::Value::{Table, Integer, Array, Float};
+use toml::map::Map;
macro_rules! t {
($e:expr) => (match $e {
@@ -63,8 +64,8 @@ macro_rules! error {
}
macro_rules! map( ($($k:ident: $v:expr),*) => ({
- let mut _m = BTreeMap::new();
- $(_m.insert(stringify!($k).to_string(), $v);)*
+ let mut _m = Map::new();
+ $(_m.insert(stringify!($k).to_string(), t!(Value::try_from($v)));)*
_m
}) );
@@ -97,7 +98,7 @@ fn smoke_hyphen() {
a_b: isize,
}
- let mut m = BTreeMap::new();
+ let mut m = Map::new();
m.insert("a-b".to_string(), Integer(2));
equivalent! {
Foo2 { a_b: 2 },