diff options
author | Alex Crichton <alex@alexcrichton.com> | 2017-06-01 08:36:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-01 08:36:08 -0500 |
commit | 36431af975092578648225c60a8494cb0d5f6844 (patch) | |
tree | 56d5a901235aa8fb7c157c0f348b257c54fa1648 /tests | |
parent | 95e1c738467c87f4072ac29923e7df399ebfe9ea (diff) | |
parent | 20dced6967398c19ae8d502bd916cc294df6a3d4 (diff) | |
download | milf-rs-36431af975092578648225c60a8494cb0d5f6844.tar.gz milf-rs-36431af975092578648225c60a8494cb0d5f6844.zip |
Merge pull request #184 from alanhdu/master
Serialize nested array of tables correctly
Diffstat (limited to 'tests')
-rw-r--r-- | tests/serde.rs | 4 | ||||
-rw-r--r-- | tests/valid.rs | 4 | ||||
-rw-r--r-- | tests/valid/table-array-nest-no-keys.json | 14 | ||||
-rw-r--r-- | tests/valid/table-array-nest-no-keys.toml | 6 |
4 files changed, 24 insertions, 4 deletions
diff --git a/tests/serde.rs b/tests/serde.rs index 0f4c37a..2f8d871 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -61,10 +61,6 @@ macro_rules! error { }) } -macro_rules! decode( ($t:expr) => ({ - t!($t.try_into()) -}) ); - macro_rules! map( ($($k:ident: $v:expr),*) => ({ let mut _m = BTreeMap::new(); $(_m.insert(stringify!($k).to_string(), $v);)* diff --git a/tests/valid.rs b/tests/valid.rs index e8ea6af..676fc67 100644 --- a/tests/valid.rs +++ b/tests/valid.rs @@ -189,3 +189,7 @@ test!(example4, test!(example_bom, include_str!("valid/example-bom.toml"), include_str!("valid/example.json")); + +test!(table_array_nest_no_keys, + include_str!("valid/table-array-nest-no-keys.toml"), + include_str!("valid/table-array-nest-no-keys.json")); diff --git a/tests/valid/table-array-nest-no-keys.json b/tests/valid/table-array-nest-no-keys.json new file mode 100644 index 0000000..7537b1a --- /dev/null +++ b/tests/valid/table-array-nest-no-keys.json @@ -0,0 +1,14 @@ +{ + "albums": [ + { + "songs": [{}, {}] + } + ], + "artists": [ + { + "home": { + "address": {} + } + } + ] +} diff --git a/tests/valid/table-array-nest-no-keys.toml b/tests/valid/table-array-nest-no-keys.toml new file mode 100644 index 0000000..ad6eb10 --- /dev/null +++ b/tests/valid/table-array-nest-no-keys.toml @@ -0,0 +1,6 @@ +[[ albums ]] + [[ albums.songs ]] + [[ albums.songs ]] + +[[ artists ]] + [ artists.home.address ] |