diff options
author | Melody Horn <melody@boringcactus.com> | 2021-03-21 14:10:24 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-03-21 14:10:24 -0600 |
commit | 7bbbfd046324363c8db1fb15d39aeb02fe7331b5 (patch) | |
tree | a416bb991c23e083d0b5816dfc8b00cd1aceda78 /test-suite/tests | |
parent | b1417006df376e6c406bff43740dd11aa7ef744e (diff) | |
download | milf-rs-7bbbfd046324363c8db1fb15d39aeb02fe7331b5.tar.gz milf-rs-7bbbfd046324363c8db1fb15d39aeb02fe7331b5.zip |
Diffstat (limited to 'test-suite/tests')
-rw-r--r-- | test-suite/tests/backcompat.rs | 14 | ||||
-rw-r--r-- | test-suite/tests/datetime.rs | 14 | ||||
-rw-r--r-- | test-suite/tests/de-errors.rs | 12 | ||||
-rw-r--r-- | test-suite/tests/display-tricky.rs | 12 | ||||
-rw-r--r-- | test-suite/tests/display.rs | 6 | ||||
-rw-r--r-- | test-suite/tests/float.rs | 10 | ||||
-rw-r--r-- | test-suite/tests/formatting.rs | 4 | ||||
-rw-r--r-- | test-suite/tests/invalid-misc.rs | 6 | ||||
-rw-r--r-- | test-suite/tests/invalid.rs | 94 | ||||
-rw-r--r-- | test-suite/tests/invalid/datetime-malformed-no-leads.milf (renamed from test-suite/tests/invalid/datetime-malformed-no-leads.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/datetime-malformed-no-secs.milf (renamed from test-suite/tests/invalid/datetime-malformed-no-secs.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/datetime-malformed-no-t.milf (renamed from test-suite/tests/invalid/datetime-malformed-no-t.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/datetime-malformed-with-milli.milf (renamed from test-suite/tests/invalid/datetime-malformed-with-milli.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/duplicate-key-table.milf (renamed from test-suite/tests/invalid/duplicate-key-table.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/duplicate-keys.milf (renamed from test-suite/tests/invalid/duplicate-keys.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/duplicate-table.milf (renamed from test-suite/tests/invalid/duplicate-table.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/duplicate-tables.milf (renamed from test-suite/tests/invalid/duplicate-tables.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/empty-implicit-table.milf (renamed from test-suite/tests/invalid/empty-implicit-table.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/empty-table.milf (renamed from test-suite/tests/invalid/empty-table.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/float-no-leading-zero.milf (renamed from test-suite/tests/invalid/float-no-leading-zero.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/float-no-suffix.milf (renamed from test-suite/tests/invalid/float-no-suffix.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/float-no-trailing-digits.milf (renamed from test-suite/tests/invalid/float-no-trailing-digits.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/key-after-array.milf (renamed from test-suite/tests/invalid/key-after-array.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/key-after-table.milf (renamed from test-suite/tests/invalid/key-after-table.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/key-empty.milf (renamed from test-suite/tests/invalid/key-empty.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/key-hash.milf (renamed from test-suite/tests/invalid/key-hash.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/key-newline.milf (renamed from test-suite/tests/invalid/key-newline.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/key-open-bracket.milf (renamed from test-suite/tests/invalid/key-open-bracket.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/key-single-open-bracket.milf (renamed from test-suite/tests/invalid/key-single-open-bracket.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/key-space.milf (renamed from test-suite/tests/invalid/key-space.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/key-start-bracket.milf (renamed from test-suite/tests/invalid/key-start-bracket.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/key-two-equals.milf (renamed from test-suite/tests/invalid/key-two-equals.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/string-bad-byte-escape.milf (renamed from test-suite/tests/invalid/string-bad-byte-escape.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/string-bad-escape.milf (renamed from test-suite/tests/invalid/string-bad-escape.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/string-bad-line-ending-escape.milf (renamed from test-suite/tests/invalid/string-bad-line-ending-escape.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/string-byte-escapes.milf (renamed from test-suite/tests/invalid/string-byte-escapes.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/string-no-close.milf (renamed from test-suite/tests/invalid/string-no-close.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/table-array-implicit.milf (renamed from test-suite/tests/invalid/table-array-implicit.toml) | 2 | ||||
-rw-r--r-- | test-suite/tests/invalid/table-array-malformed-bracket.milf (renamed from test-suite/tests/invalid/table-array-malformed-bracket.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/table-array-malformed-empty.milf (renamed from test-suite/tests/invalid/table-array-malformed-empty.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/table-empty.milf (renamed from test-suite/tests/invalid/table-empty.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/table-nested-brackets-close.milf (renamed from test-suite/tests/invalid/table-nested-brackets-close.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/table-nested-brackets-open.milf (renamed from test-suite/tests/invalid/table-nested-brackets-open.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/table-whitespace.milf (renamed from test-suite/tests/invalid/table-whitespace.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/table-with-pound.milf (renamed from test-suite/tests/invalid/table-with-pound.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/text-after-array-entries.milf (renamed from test-suite/tests/invalid/text-after-array-entries.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/text-after-integer.milf (renamed from test-suite/tests/invalid/text-after-integer.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/text-after-string.milf (renamed from test-suite/tests/invalid/text-after-string.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/text-after-table.milf (renamed from test-suite/tests/invalid/text-after-table.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/text-before-array-separator.milf (renamed from test-suite/tests/invalid/text-before-array-separator.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/invalid/text-in-array.milf (renamed from test-suite/tests/invalid/text-in-array.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/macros.rs | 38 | ||||
-rw-r--r-- | test-suite/tests/parser.rs | 22 | ||||
-rw-r--r-- | test-suite/tests/pretty.rs | 104 | ||||
-rw-r--r-- | test-suite/tests/serde.rs | 64 | ||||
-rw-r--r-- | test-suite/tests/spanned-impls.rs | 2 | ||||
-rw-r--r-- | test-suite/tests/spanned.rs | 22 | ||||
-rw-r--r-- | test-suite/tests/tables-last.rs | 6 | ||||
-rw-r--r-- | test-suite/tests/valid.rs | 196 | ||||
-rw-r--r-- | test-suite/tests/valid/array-empty.milf (renamed from test-suite/tests/valid/array-empty.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/array-mixed-types-arrays-and-ints.milf (renamed from test-suite/tests/valid/array-mixed-types-arrays-and-ints.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/array-mixed-types-ints-and-floats.milf (renamed from test-suite/tests/valid/array-mixed-types-ints-and-floats.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/array-mixed-types-strings-and-ints.milf (renamed from test-suite/tests/valid/array-mixed-types-strings-and-ints.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/array-nospaces.milf (renamed from test-suite/tests/valid/array-nospaces.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/arrays-hetergeneous.milf (renamed from test-suite/tests/valid/arrays-hetergeneous.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/arrays-nested.milf (renamed from test-suite/tests/valid/arrays-nested.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/arrays.milf (renamed from test-suite/tests/valid/arrays.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/bool.milf (renamed from test-suite/tests/valid/bool.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/comments-everywhere.milf (renamed from test-suite/tests/valid/comments-everywhere.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/datetime-truncate.milf (renamed from test-suite/tests/valid/datetime-truncate.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/datetime.milf (renamed from test-suite/tests/valid/datetime.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/dotted-keys.milf (renamed from test-suite/tests/valid/dotted-keys.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/empty.milf (renamed from test-suite/tests/valid/empty.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/example-bom.milf (renamed from test-suite/tests/valid/example-bom.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/example-v0.3.0.milf (renamed from test-suite/tests/valid/example-v0.3.0.toml) | 2 | ||||
-rw-r--r-- | test-suite/tests/valid/example-v0.4.0.milf (renamed from test-suite/tests/valid/example-v0.4.0.toml) | 2 | ||||
-rw-r--r-- | test-suite/tests/valid/example.milf (renamed from test-suite/tests/valid/example.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/example2.json | 2 | ||||
-rw-r--r-- | test-suite/tests/valid/example2.milf (renamed from test-suite/tests/valid/example2.toml) | 6 | ||||
-rw-r--r-- | test-suite/tests/valid/float-exponent.milf (renamed from test-suite/tests/valid/float-exponent.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/float.milf (renamed from test-suite/tests/valid/float.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/hard_example.milf (renamed from test-suite/tests/valid/hard_example.toml) | 4 | ||||
-rw-r--r-- | test-suite/tests/valid/implicit-and-explicit-after.milf (renamed from test-suite/tests/valid/implicit-and-explicit-after.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/implicit-and-explicit-before.milf (renamed from test-suite/tests/valid/implicit-and-explicit-before.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/implicit-groups.milf (renamed from test-suite/tests/valid/implicit-groups.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/integer.milf (renamed from test-suite/tests/valid/integer.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/key-equals-nospace.milf (renamed from test-suite/tests/valid/key-equals-nospace.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/key-quote-newline.milf (renamed from test-suite/tests/valid/key-quote-newline.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/key-space.milf (renamed from test-suite/tests/valid/key-space.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/key-special-chars.milf (renamed from test-suite/tests/valid/key-special-chars.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/key-with-pound.milf (renamed from test-suite/tests/valid/key-with-pound.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/long-float.milf (renamed from test-suite/tests/valid/long-float.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/long-integer.milf (renamed from test-suite/tests/valid/long-integer.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/multiline-string.milf (renamed from test-suite/tests/valid/multiline-string.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/quote-surrounded-value.milf (renamed from test-suite/tests/valid/quote-surrounded-value.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/raw-multiline-string.milf (renamed from test-suite/tests/valid/raw-multiline-string.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/raw-string.milf (renamed from test-suite/tests/valid/raw-string.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/string-delim-end.milf (renamed from test-suite/tests/valid/string-delim-end.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/string-empty.milf (renamed from test-suite/tests/valid/string-empty.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/string-escapes.milf (renamed from test-suite/tests/valid/string-escapes.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/string-simple.milf (renamed from test-suite/tests/valid/string-simple.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/string-with-pound.milf (renamed from test-suite/tests/valid/string-with-pound.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/table-array-implicit.milf (renamed from test-suite/tests/valid/table-array-implicit.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/table-array-many.milf (renamed from test-suite/tests/valid/table-array-many.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/table-array-nest-no-keys.milf (renamed from test-suite/tests/valid/table-array-nest-no-keys.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/table-array-nest.milf (renamed from test-suite/tests/valid/table-array-nest.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/table-array-one.milf (renamed from test-suite/tests/valid/table-array-one.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/table-empty.milf (renamed from test-suite/tests/valid/table-empty.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/table-multi-empty.milf (renamed from test-suite/tests/valid/table-multi-empty.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/table-sub-empty.milf (renamed from test-suite/tests/valid/table-sub-empty.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/table-whitespace.milf (renamed from test-suite/tests/valid/table-whitespace.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/table-with-pound.milf (renamed from test-suite/tests/valid/table-with-pound.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/unicode-escape.milf (renamed from test-suite/tests/valid/unicode-escape.toml) | 0 | ||||
-rw-r--r-- | test-suite/tests/valid/unicode-literal.milf (renamed from test-suite/tests/valid/unicode-literal.toml) | 0 |
114 files changed, 322 insertions, 322 deletions
diff --git a/test-suite/tests/backcompat.rs b/test-suite/tests/backcompat.rs index ef3bd36..7d4fcee 100644 --- a/test-suite/tests/backcompat.rs +++ b/test-suite/tests/backcompat.rs @@ -1,11 +1,11 @@ extern crate serde; -extern crate toml; +extern crate milf; use serde::de::Deserialize; macro_rules! bad { - ($toml:expr, $msg:expr) => { - match $toml.parse::<toml::Value>() { + ($milf:expr, $msg:expr) => { + match $milf.parse::<milf::Value>() { Ok(s) => panic!("parsed to: {:#?}", s), Err(e) => assert_eq!(e.to_string(), $msg), } @@ -23,9 +23,9 @@ fn newlines_after_tables() { "expected newline, found an identifier at line 2 column 13" ); - let mut d = toml::de::Deserializer::new(s); + let mut d = milf::de::Deserializer::new(s); d.set_require_newline_after_table(false); - let value = toml::Value::deserialize(&mut d).unwrap(); + let value = milf::Value::deserialize(&mut d).unwrap(); assert_eq!(value["a"]["foo"].as_integer(), Some(1)); assert_eq!(value["b"][0]["foo"].as_integer(), Some(1)); } @@ -47,9 +47,9 @@ fn allow_duplicate_after_longer() { "redefinition of table `dependencies` for key `dependencies` at line 8 column 9" ); - let mut d = toml::de::Deserializer::new(s); + let mut d = milf::de::Deserializer::new(s); d.set_allow_duplicate_after_longer_table(true); - let value = toml::Value::deserialize(&mut d).unwrap(); + let value = milf::Value::deserialize(&mut d).unwrap(); assert_eq!( value["dependencies"]["openssl-sys"]["version"].as_integer(), Some(1) diff --git a/test-suite/tests/datetime.rs b/test-suite/tests/datetime.rs index 6c08748..729591e 100644 --- a/test-suite/tests/datetime.rs +++ b/test-suite/tests/datetime.rs @@ -1,10 +1,10 @@ -extern crate toml; +extern crate milf; use std::str::FromStr; macro_rules! bad { - ($toml:expr, $msg:expr) => { - match $toml.parse::<toml::Value>() { + ($milf:expr, $msg:expr) => { + match $milf.parse::<milf::Value>() { Ok(s) => panic!("parsed to: {:#?}", s), Err(e) => assert_eq!(e.to_string(), $msg), } @@ -15,7 +15,7 @@ macro_rules! bad { fn times() { fn dogood(s: &str, serialized: &str) { let to_parse = format!("foo = {}", s); - let value = toml::Value::from_str(&to_parse).unwrap(); + let value = milf::Value::from_str(&to_parse).unwrap(); assert_eq!(value["foo"].as_datetime().unwrap().to_string(), serialized); } fn good(s: &str) { @@ -68,15 +68,15 @@ fn bad_times() { ); bad!( "foo = T", - "invalid TOML value, did you mean to use a quoted string? at line 1 column 7" + "invalid MILF value, did you mean to use a quoted string? at line 1 column 7" ); bad!( "foo = T.", - "invalid TOML value, did you mean to use a quoted string? at line 1 column 7" + "invalid MILF value, did you mean to use a quoted string? at line 1 column 7" ); bad!( "foo = TZ", - "invalid TOML value, did you mean to use a quoted string? at line 1 column 7" + "invalid MILF value, did you mean to use a quoted string? at line 1 column 7" ); bad!( "foo = 1997-09-09T09:09:09.09+", diff --git a/test-suite/tests/de-errors.rs b/test-suite/tests/de-errors.rs index 7666489..656dd49 100644 --- a/test-suite/tests/de-errors.rs +++ b/test-suite/tests/de-errors.rs @@ -1,12 +1,12 @@ extern crate serde; -extern crate toml; +extern crate milf; use serde::{de, Deserialize}; use std::fmt; macro_rules! bad { - ($toml:expr, $ty:ty, $msg:expr) => { - match toml::from_str::<$ty>($toml) { + ($milf:expr, $ty:ty, $msg:expr) => { + match milf::from_str::<$ty>($milf) { Ok(s) => panic!("parsed to: {:#?}", s), Err(e) => assert_eq!(e.to_string(), $msg), } @@ -71,7 +71,7 @@ impl<'de> de::Deserialize<'de> for CasedString { #[test] fn custom_errors() { - toml::from_str::<Parent<CasedString>>( + milf::from_str::<Parent<CasedString>>( " p_a = 'a' p_b = [{c_a = 'a', c_b = 'c'}] @@ -333,7 +333,7 @@ fn error_handles_crlf() { a = 1\r\n\ a = 2\r\n\ ", - toml::Value, + milf::Value, "duplicate key: `a` for key `t2` at line 3 column 1" ); @@ -345,7 +345,7 @@ fn error_handles_crlf() { a = 1\n\ a = 2\n\ ", - toml::Value, + milf::Value, "duplicate key: `a` for key `t2` at line 3 column 1" ); } diff --git a/test-suite/tests/display-tricky.rs b/test-suite/tests/display-tricky.rs index 0daa10e..631ce70 100644 --- a/test-suite/tests/display-tricky.rs +++ b/test-suite/tests/display-tricky.rs @@ -1,4 +1,4 @@ -extern crate toml; +extern crate milf; #[macro_use] extern crate serde_derive; @@ -26,7 +26,7 @@ pub struct Packages { #[test] fn both_ends() { - let recipe_works = toml::from_str::<Recipe>( + let recipe_works = milf::from_str::<Recipe>( r#" name = "testing" description = "example" @@ -37,9 +37,9 @@ fn both_ends() { "#, ) .unwrap(); - toml::to_string(&recipe_works).unwrap(); + milf::to_string(&recipe_works).unwrap(); - let recipe_fails = toml::from_str::<Recipe>( + let recipe_fails = milf::from_str::<Recipe>( r#" name = "testing" description = "example" @@ -51,6 +51,6 @@ fn both_ends() { ) .unwrap(); - let recipe_toml = toml::Value::try_from(recipe_fails).unwrap(); - recipe_toml.to_string(); + let recipe_milf = milf::Value::try_from(recipe_fails).unwrap(); + recipe_milf.to_string(); } diff --git a/test-suite/tests/display.rs b/test-suite/tests/display.rs index 5d9f44a..73067e6 100644 --- a/test-suite/tests/display.rs +++ b/test-suite/tests/display.rs @@ -1,7 +1,7 @@ -extern crate toml; +extern crate milf; -use toml::map::Map; -use toml::Value::{Array, Boolean, Float, Integer, String, Table}; +use milf::map::Map; +use milf::Value::{Array, Boolean, Float, Integer, String, Table}; macro_rules! map( ($($k:expr => $v:expr),*) => ({ let mut _m = Map::new(); diff --git a/test-suite/tests/float.rs b/test-suite/tests/float.rs index 66414ea..0b639dc 100644 --- a/test-suite/tests/float.rs +++ b/test-suite/tests/float.rs @@ -1,8 +1,8 @@ -extern crate toml; +extern crate milf; #[macro_use] extern crate serde_derive; -use toml::Value; +use milf::Value; #[rustfmt::skip] // appears to be a bug in rustfmt to make this converge... macro_rules! float_inf_tests { @@ -18,7 +18,7 @@ macro_rules! float_inf_tests { sf7: $ty, sf8: $ty, } - let inf: S = toml::from_str( + let inf: S = milf::from_str( r" # infinity sf1 = inf # positive infinity @@ -56,7 +56,7 @@ macro_rules! float_inf_tests { assert_eq!(inf.sf8, 0.0); assert!(inf.sf8.is_sign_negative()); - let s = toml::to_string(&inf).unwrap(); + let s = milf::to_string(&inf).unwrap(); assert_eq!( s, "\ @@ -71,7 +71,7 @@ sf8 = -0.0 " ); - toml::from_str::<Value>(&s).expect("roundtrip"); + milf::from_str::<Value>(&s).expect("roundtrip"); }}; } diff --git a/test-suite/tests/formatting.rs b/test-suite/tests/formatting.rs index 8e15ec2..b459d5f 100644 --- a/test-suite/tests/formatting.rs +++ b/test-suite/tests/formatting.rs @@ -1,8 +1,8 @@ #[macro_use] extern crate serde_derive; -extern crate toml; +extern crate milf; -use toml::to_string; +use milf::to_string; #[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)] struct User { diff --git a/test-suite/tests/invalid-misc.rs b/test-suite/tests/invalid-misc.rs index cea0801..14fc6c3 100644 --- a/test-suite/tests/invalid-misc.rs +++ b/test-suite/tests/invalid-misc.rs @@ -1,8 +1,8 @@ -extern crate toml; +extern crate milf; macro_rules! bad { - ($toml:expr, $msg:expr) => { - match $toml.parse::<toml::Value>() { + ($milf:expr, $msg:expr) => { + match $milf.parse::<milf::Value>() { Ok(s) => panic!("parsed to: {:#?}", s), Err(e) => assert_eq!(e.to_string(), $msg), } diff --git a/test-suite/tests/invalid.rs b/test-suite/tests/invalid.rs index f04d860..119e748 100644 --- a/test-suite/tests/invalid.rs +++ b/test-suite/tests/invalid.rs @@ -1,8 +1,8 @@ -extern crate toml; +extern crate milf; macro_rules! bad { - ($toml:expr, $msg:expr) => { - match $toml.parse::<toml::Value>() { + ($milf:expr, $msg:expr) => { + match $milf.parse::<milf::Value>() { Ok(s) => panic!("parsed to: {:#?}", s), Err(e) => assert_eq!(e.to_string(), $msg), } @@ -16,211 +16,211 @@ macro_rules! test( ($name:ident, $s:expr, $msg:expr) => ( test!( datetime_malformed_no_leads, - include_str!("invalid/datetime-malformed-no-leads.toml"), + include_str!("invalid/datetime-malformed-no-leads.milf"), "failed to parse datetime for key `no-leads` at line 1 column 12" ); test!( datetime_malformed_no_secs, - include_str!("invalid/datetime-malformed-no-secs.toml"), + include_str!("invalid/datetime-malformed-no-secs.milf"), "expected a colon, found a newline at line 1 column 28" ); test!( datetime_malformed_no_t, - include_str!("invalid/datetime-malformed-no-t.toml"), + include_str!("invalid/datetime-malformed-no-t.milf"), "failed to parse datetime for key `no-t` at line 1 column 8" ); test!( datetime_malformed_with_milli, - include_str!("invalid/datetime-malformed-with-milli.toml"), + include_str!("invalid/datetime-malformed-with-milli.milf"), "failed to parse datetime for key `with-milli` at line 1 column 14" ); test!( duplicate_key_table, - include_str!("invalid/duplicate-key-table.toml"), + include_str!("invalid/duplicate-key-table.milf"), "duplicate key: `type` for key `fruit` at line 4 column 1" ); test!( duplicate_keys, - include_str!("invalid/duplicate-keys.toml"), + include_str!("invalid/duplicate-keys.milf"), "duplicate key: `dupe` at line 1 column 1" ); test!( duplicate_table, - include_str!("invalid/duplicate-table.toml"), + include_str!("invalid/duplicate-table.milf"), "redefinition of table `dependencies` for key `dependencies` at line 7 column 1" ); test!( duplicate_tables, - include_str!("invalid/duplicate-tables.toml"), + include_str!("invalid/duplicate-tables.milf"), "redefinition of table `a` for key `a` at line 2 column 1" ); test!( empty_implicit_table, - include_str!("invalid/empty-implicit-table.toml"), + include_str!("invalid/empty-implicit-table.milf"), "expected a table key, found a period at line 1 column 10" ); test!( empty_table, - include_str!("invalid/empty-table.toml"), + include_str!("invalid/empty-table.milf"), "expected a table key, found a right bracket at line 1 column 2" ); test!( float_no_leading_zero, - include_str!("invalid/float-no-leading-zero.toml"), + include_str!("invalid/float-no-leading-zero.milf"), "expected a value, found a period at line 1 column 10" ); test!( float_no_suffix, - include_str!("invalid/float-no-suffix.toml"), + include_str!("invalid/float-no-suffix.milf"), "invalid number at line 1 column 5" ); test!( float_no_trailing_digits, - include_str!("invalid/float-no-trailing-digits.toml"), + include_str!("invalid/float-no-trailing-digits.milf"), "invalid number at line 1 column 12" ); test!( key_after_array, - include_str!("invalid/key-after-array.toml"), + include_str!("invalid/key-after-array.milf"), "expected newline, found an identifier at line 1 column 14" ); test!( key_after_table, - include_str!("invalid/key-after-table.toml"), + include_str!("invalid/key-after-table.milf"), "expected newline, found an identifier at line 1 column 11" ); test!( key_empty, - include_str!("invalid/key-empty.toml"), + include_str!("invalid/key-empty.milf"), "expected a table key, found an equals at line 1 column 2" ); test!( key_hash, - include_str!("invalid/key-hash.toml"), + include_str!("invalid/key-hash.milf"), "expected an equals, found a comment at line 1 column 2" ); test!( key_newline, - include_str!("invalid/key-newline.toml"), + include_str!("invalid/key-newline.milf"), "expected an equals, found a newline at line 1 column 2" ); test!( key_open_bracket, - include_str!("invalid/key-open-bracket.toml"), + include_str!("invalid/key-open-bracket.milf"), "expected a right bracket, found an equals at line 1 column 6" ); test!( key_single_open_bracket, - include_str!("invalid/key-single-open-bracket.toml"), + include_str!("invalid/key-single-open-bracket.milf"), "expected a table key, found eof at line 1 column 2" ); test!( key_space, - include_str!("invalid/key-space.toml"), + include_str!("invalid/key-space.milf"), "expected an equals, found an identifier at line 1 column 3" ); test!( key_start_bracket, - include_str!("invalid/key-start-bracket.toml"), + include_str!("invalid/key-start-bracket.milf"), "expected a right bracket, found an equals at line 2 column 6" ); test!( key_two_equals, - include_str!("invalid/key-two-equals.toml"), + include_str!("invalid/key-two-equals.milf"), "expected a value, found an equals at line 1 column 6" ); test!( string_bad_byte_escape, - include_str!("invalid/string-bad-byte-escape.toml"), + include_str!("invalid/string-bad-byte-escape.milf"), "invalid escape character in string: `x` at line 1 column 13" ); test!( string_bad_escape, - include_str!("invalid/string-bad-escape.toml"), + include_str!("invalid/string-bad-escape.milf"), "invalid escape character in string: `a` at line 1 column 42" ); test!( string_bad_line_ending_escape, - include_str!("invalid/string-bad-line-ending-escape.toml"), + include_str!("invalid/string-bad-line-ending-escape.milf"), "invalid escape character in string: ` ` at line 2 column 79" ); test!( string_byte_escapes, - include_str!("invalid/string-byte-escapes.toml"), + include_str!("invalid/string-byte-escapes.milf"), "invalid escape character in string: `x` at line 1 column 12" ); test!( string_no_close, - include_str!("invalid/string-no-close.toml"), + include_str!("invalid/string-no-close.milf"), "newline in string found at line 1 column 42" ); test!( table_array_implicit, - include_str!("invalid/table-array-implicit.toml"), + include_str!("invalid/table-array-implicit.milf"), "table redefined as array for key `albums` at line 13 column 1" ); test!( table_array_malformed_bracket, - include_str!("invalid/table-array-malformed-bracket.toml"), + include_str!("invalid/table-array-malformed-bracket.milf"), "expected a right bracket, found a newline at line 1 column 10" ); test!( table_array_malformed_empty, - include_str!("invalid/table-array-malformed-empty.toml"), + include_str!("invalid/table-array-malformed-empty.milf"), "expected a table key, found a right bracket at line 1 column 3" ); test!( table_empty, - include_str!("invalid/table-empty.toml"), + include_str!("invalid/table-empty.milf"), "expected a table key, found a right bracket at line 1 column 2" ); test!( table_nested_brackets_close, - include_str!("invalid/table-nested-brackets-close.toml"), + include_str!("invalid/table-nested-brackets-close.milf"), "expected newline, found an identifier at line 1 column 4" ); test!( table_nested_brackets_open, - include_str!("invalid/table-nested-brackets-open.toml"), + include_str!("invalid/table-nested-brackets-open.milf"), "expected a right bracket, found a left bracket at line 1 column 3" ); test!( table_whitespace, - include_str!("invalid/table-whitespace.toml"), + include_str!("invalid/table-whitespace.milf"), "expected a right bracket, found an identifier at line 1 column 10" ); test!( table_with_pound, - include_str!("invalid/table-with-pound.toml"), + include_str!("invalid/table-with-pound.milf"), "expected a right bracket, found a comment at line 1 column 5" ); test!( text_after_array_entries, - include_str!("invalid/text-after-array-entries.toml"), - "invalid TOML value, did you mean to use a quoted string? at line 2 column 46" + include_str!("invalid/text-after-array-entries.milf"), + "invalid MILF value, did you mean to use a quoted string? at line 2 column 46" ); test!( text_after_integer, - include_str!("invalid/text-after-integer.toml"), + include_str!("invalid/text-after-integer.milf"), "expected newline, found an identifier at line 1 column 13" ); test!( text_after_string, - include_str!("invalid/text-after-string.toml"), + include_str!("invalid/text-after-string.milf"), "expected newline, found an identifier at line 1 column 41" ); test!( text_after_table, - include_str!("invalid/text-after-table.toml"), + include_str!("invalid/text-after-table.milf"), "expected newline, found an identifier at line 1 column 9" ); test!( text_before_array_separator, - include_str!("invalid/text-before-array-separator.toml"), + include_str!("invalid/text-before-array-separator.milf"), "expected a right bracket, found an identifier at line 2 column 46" ); test!( text_in_array, - include_str!("invalid/text-in-array.toml"), - "invalid TOML value, did you mean to use a quoted string? at line 3 column 3" + include_str!("invalid/text-in-array.milf"), + "invalid MILF value, did you mean to use a quoted string? at line 3 column 3" ); diff --git a/test-suite/tests/invalid/datetime-malformed-no-leads.toml b/test-suite/tests/invalid/datetime-malformed-no-leads.milf index 123f173..123f173 100644 --- a/test-suite/tests/invalid/datetime-malformed-no-leads.toml +++ b/test-suite/tests/invalid/datetime-malformed-no-leads.milf diff --git a/test-suite/tests/invalid/datetime-malformed-no-secs.toml b/test-suite/tests/invalid/datetime-malformed-no-secs.milf index ba93900..ba93900 100644 --- a/test-suite/tests/invalid/datetime-malformed-no-secs.toml +++ b/test-suite/tests/invalid/datetime-malformed-no-secs.milf diff --git a/test-suite/tests/invalid/datetime-malformed-no-t.toml b/test-suite/tests/invalid/datetime-malformed-no-t.milf index 617e3c5..617e3c5 100644 --- a/test-suite/tests/invalid/datetime-malformed-no-t.toml +++ b/test-suite/tests/invalid/datetime-malformed-no-t.milf diff --git a/test-suite/tests/invalid/datetime-malformed-with-milli.toml b/test-suite/tests/invalid/datetime-malformed-with-milli.milf index eef792f..eef792f 100644 --- a/test-suite/tests/invalid/datetime-malformed-with-milli.toml +++ b/test-suite/tests/invalid/datetime-malformed-with-milli.milf diff --git a/test-suite/tests/invalid/duplicate-key-table.toml b/test-suite/tests/invalid/duplicate-key-table.milf index cedf05f..cedf05f 100644 --- a/test-suite/tests/invalid/duplicate-key-table.toml +++ b/test-suite/tests/invalid/duplicate-key-table.milf diff --git a/test-suite/tests/invalid/duplicate-keys.toml b/test-suite/tests/invalid/duplicate-keys.milf index 9b5aee0..9b5aee0 100644 --- a/test-suite/tests/invalid/duplicate-keys.toml +++ b/test-suite/tests/invalid/duplicate-keys.milf diff --git a/test-suite/tests/invalid/duplicate-table.toml b/test-suite/tests/invalid/duplicate-table.milf index 5bd2571..5bd2571 100644 --- a/test-suite/tests/invalid/duplicate-table.toml +++ b/test-suite/tests/invalid/duplicate-table.milf diff --git a/test-suite/tests/invalid/duplicate-tables.toml b/test-suite/tests/invalid/duplicate-tables.milf index 8ddf49b..8ddf49b 100644 --- a/test-suite/tests/invalid/duplicate-tables.toml +++ b/test-suite/tests/invalid/duplicate-tables.milf diff --git a/test-suite/tests/invalid/empty-implicit-table.toml b/test-suite/tests/invalid/empty-implicit-table.milf index 0cc36d0..0cc36d0 100644 --- a/test-suite/tests/invalid/empty-implicit-table.toml +++ b/test-suite/tests/invalid/empty-implicit-table.milf diff --git a/test-suite/tests/invalid/empty-table.toml b/test-suite/tests/invalid/empty-table.milf index fe51488..fe51488 100644 --- a/test-suite/tests/invalid/empty-table.toml +++ b/test-suite/tests/invalid/empty-table.milf diff --git a/test-suite/tests/invalid/float-no-leading-zero.toml b/test-suite/tests/invalid/float-no-leading-zero.milf index cab76bf..cab76bf 100644 --- a/test-suite/tests/invalid/float-no-leading-zero.toml +++ b/test-suite/tests/invalid/float-no-leading-zero.milf diff --git a/test-suite/tests/invalid/float-no-suffix.toml b/test-suite/tests/invalid/float-no-suffix.milf index 76106de..76106de 100644 --- a/test-suite/tests/invalid/float-no-suffix.toml +++ b/test-suite/tests/invalid/float-no-suffix.milf diff --git a/test-suite/tests/invalid/float-no-trailing-digits.toml b/test-suite/tests/invalid/float-no-trailing-digits.milf index cbff2d0..cbff2d0 100644 --- a/test-suite/tests/invalid/float-no-trailing-digits.toml +++ b/test-suite/tests/invalid/float-no-trailing-digits.milf diff --git a/test-suite/tests/invalid/key-after-array.toml b/test-suite/tests/invalid/key-after-array.milf index 5c1a1b0..5c1a1b0 100644 --- a/test-suite/tests/invalid/key-after-array.toml +++ b/test-suite/tests/invalid/key-after-array.milf diff --git a/test-suite/tests/invalid/key-after-table.toml b/test-suite/tests/invalid/key-after-table.milf index 4bc8213..4bc8213 100644 --- a/test-suite/tests/invalid/key-after-table.toml +++ b/test-suite/tests/invalid/key-after-table.milf diff --git a/test-suite/tests/invalid/key-empty.toml b/test-suite/tests/invalid/key-empty.milf index 09f998f..09f998f 100644 --- a/test-suite/tests/invalid/key-empty.toml +++ b/test-suite/tests/invalid/key-empty.milf diff --git a/test-suite/tests/invalid/key-hash.toml b/test-suite/tests/invalid/key-hash.milf index e321b1f..e321b1f 100644 --- a/test-suite/tests/invalid/key-hash.toml +++ b/test-suite/tests/invalid/key-hash.milf diff --git a/test-suite/tests/invalid/key-newline.toml b/test-suite/tests/invalid/key-newline.milf index 707aad5..707aad5 100644 --- a/test-suite/tests/invalid/key-newline.toml +++ b/test-suite/tests/invalid/key-newline.milf diff --git a/test-suite/tests/invalid/key-open-bracket.toml b/test-suite/tests/invalid/key-open-bracket.milf index f0aeb16..f0aeb16 100644 --- a/test-suite/tests/invalid/key-open-bracket.toml +++ b/test-suite/tests/invalid/key-open-bracket.milf diff --git a/test-suite/tests/invalid/key-single-open-bracket.toml b/test-suite/tests/invalid/key-single-open-bracket.milf index 8e2f0be..8e2f0be 100644 --- a/test-suite/tests/invalid/key-single-open-bracket.toml +++ b/test-suite/tests/invalid/key-single-open-bracket.milf diff --git a/test-suite/tests/invalid/key-space.toml b/test-suite/tests/invalid/key-space.milf index 201806d..201806d 100644 --- a/test-suite/tests/invalid/key-space.toml +++ b/test-suite/tests/invalid/key-space.milf diff --git a/test-suite/tests/invalid/key-start-bracket.toml b/test-suite/tests/invalid/key-start-bracket.milf index e0597ae..e0597ae 100644 --- a/test-suite/tests/invalid/key-start-bracket.toml +++ b/test-suite/tests/invalid/key-start-bracket.milf diff --git a/test-suite/tests/invalid/key-two-equals.toml b/test-suite/tests/invalid/key-two-equals.milf index 25a0378..25a0378 100644 --- a/test-suite/tests/invalid/key-two-equals.toml +++ b/test-suite/tests/invalid/key-two-equals.milf diff --git a/test-suite/tests/invalid/string-bad-byte-escape.toml b/test-suite/tests/invalid/string-bad-byte-escape.milf index 4c7be59..4c7be59 100644 --- a/test-suite/tests/invalid/string-bad-byte-escape.toml +++ b/test-suite/tests/invalid/string-bad-byte-escape.milf diff --git a/test-suite/tests/invalid/string-bad-escape.toml b/test-suite/tests/invalid/string-bad-escape.milf index 60acb0c..60acb0c 100644 --- a/test-suite/tests/invalid/string-bad-escape.toml +++ b/test-suite/tests/invalid/string-bad-escape.milf diff --git a/test-suite/tests/invalid/string-bad-line-ending-escape.toml b/test-suite/tests/invalid/string-bad-line-ending-escape.milf index 32e2c48..32e2c48 100644 --- a/test-suite/tests/invalid/string-bad-line-ending-escape.toml +++ b/test-suite/tests/invalid/string-bad-line-ending-escape.milf diff --git a/test-suite/tests/invalid/string-byte-escapes.toml b/test-suite/tests/invalid/string-byte-escapes.milf index e94452a..e94452a 100644 --- a/test-suite/tests/invalid/string-byte-escapes.toml +++ b/test-suite/tests/invalid/string-byte-escapes.milf diff --git a/test-suite/tests/invalid/string-no-close.toml b/test-suite/tests/invalid/string-no-close.milf index 0c292fc..0c292fc 100644 --- a/test-suite/tests/invalid/string-no-close.toml +++ b/test-suite/tests/invalid/string-no-close.milf diff --git a/test-suite/tests/invalid/table-array-implicit.toml b/test-suite/tests/invalid/table-array-implicit.milf index 05f2507..a0b4e0c 100644 --- a/test-suite/tests/invalid/table-array-implicit.toml +++ b/test-suite/tests/invalid/table-array-implicit.milf @@ -1,7 +1,7 @@ # This test is a bit tricky. It should fail because the first use of # `[[albums.songs]]` without first declaring `albums` implies that `albums` # must be a table. The alternative would be quite weird. Namely, it wouldn't -# comply with the TOML spec: "Each double-bracketed sub-table will belong to +# comply with the MILF spec: "Each double-bracketed sub-table will belong to # the most *recently* defined table element *above* it." # # This is in contrast to the *valid* test, table-array-implicit where diff --git a/test-suite/tests/invalid/table-array-malformed-bracket.toml b/test-suite/tests/invalid/table-array-malformed-bracket.milf index 39c73b0..39c73b0 100644 --- a/test-suite/tests/invalid/table-array-malformed-bracket.toml +++ b/test-suite/tests/invalid/table-array-malformed-bracket.milf diff --git a/test-suite/tests/invalid/table-array-malformed-empty.toml b/test-suite/tests/invalid/table-array-malformed-empty.milf index a470ca3..a470ca3 100644 --- a/test-suite/tests/invalid/table-array-malformed-empty.toml +++ b/test-suite/tests/invalid/table-array-malformed-empty.milf diff --git a/test-suite/tests/invalid/table-empty.toml b/test-suite/tests/invalid/table-empty.milf index fe51488..fe51488 100644 --- a/test-suite/tests/invalid/table-empty.toml +++ b/test-suite/tests/invalid/table-empty.milf diff --git a/test-suite/tests/invalid/table-nested-brackets-close.toml b/test-suite/tests/invalid/table-nested-brackets-close.milf index c8b5a67..c8b5a67 100644 --- a/test-suite/tests/invalid/table-nested-brackets-close.toml +++ b/test-suite/tests/invalid/table-nested-brackets-close.milf diff --git a/test-suite/tests/invalid/table-nested-brackets-open.toml b/test-suite/tests/invalid/table-nested-brackets-open.milf index 246d7e9..246d7e9 100644 --- a/test-suite/tests/invalid/table-nested-brackets-open.toml +++ b/test-suite/tests/invalid/table-nested-brackets-open.milf diff --git a/test-suite/tests/invalid/table-whitespace.toml b/test-suite/tests/invalid/table-whitespace.milf index 79bbcb1..79bbcb1 100644 --- a/test-suite/tests/invalid/table-whitespace.toml +++ b/test-suite/tests/invalid/table-whitespace.milf diff --git a/test-suite/tests/invalid/table-with-pound.toml b/test-suite/tests/invalid/table-with-pound.milf index 0d8edb5..0d8edb5 100644 --- a/test-suite/tests/invalid/table-with-pound.toml +++ b/test-suite/tests/invalid/table-with-pound.milf diff --git a/test-suite/tests/invalid/text-after-array-entries.toml b/test-suite/tests/invalid/text-after-array-entries.milf index 1a72890..1a72890 100644 --- a/test-suite/tests/invalid/text-after-array-entries.toml +++ b/test-suite/tests/invalid/text-after-array-entries.milf diff --git a/test-suite/tests/invalid/text-after-integer.toml b/test-suite/tests/invalid/text-after-integer.milf index 42de7af..42de7af 100644 --- a/test-suite/tests/invalid/text-after-integer.toml +++ b/test-suite/tests/invalid/text-after-integer.milf diff --git a/test-suite/tests/invalid/text-after-string.toml b/test-suite/tests/invalid/text-after-string.milf index c92a6f1..c92a6f1 100644 --- a/test-suite/tests/invalid/text-after-string.toml +++ b/test-suite/tests/invalid/text-after-string.milf diff --git a/test-suite/tests/invalid/text-after-table.toml b/test-suite/tests/invalid/text-after-table.milf index 87da9db..87da9db 100644 --- a/test-suite/tests/invalid/text-after-table.toml +++ b/test-suite/tests/invalid/text-after-table.milf diff --git a/test-suite/tests/invalid/text-before-array-separator.toml b/test-suite/tests/invalid/text-before-array-separator.milf index 9b06a39..9b06a39 100644 --- a/test-suite/tests/invalid/text-before-array-separator.toml +++ b/test-suite/tests/invalid/text-before-array-separator.milf diff --git a/test-suite/tests/invalid/text-in-array.toml b/test-suite/tests/invalid/text-in-array.milf index a6a6c42..a6a6c42 100644 --- a/test-suite/tests/invalid/text-in-array.toml +++ b/test-suite/tests/invalid/text-in-array.milf diff --git a/test-suite/tests/macros.rs b/test-suite/tests/macros.rs index 20831a0..3cc5e81 100644 --- a/test-suite/tests/macros.rs +++ b/test-suite/tests/macros.rs @@ -1,7 +1,7 @@ #![recursion_limit = "256"] #[macro_use] -extern crate toml; +extern crate milf; use std::f64; @@ -9,11 +9,11 @@ macro_rules! table { ($($key:expr => $value:expr,)*) => {{ // https://github.com/rust-lang/rust/issues/60643 #[allow(unused_mut)] - let mut table = toml::value::Table::new(); + let mut table = milf::value::Table::new(); $( table.insert($key.to_string(), $value.into()); )* - toml::Value::Table(table) + milf::Value::Table(table) }}; } @@ -21,22 +21,22 @@ macro_rules! array { ($($element:expr,)*) => {{ // https://github.com/rust-lang/rust/issues/60643 #[allow(unused_mut)] - let mut array = toml::value::Array::new(); + let mut array = milf::value::Array::new(); $( array.push($element.into()); )* - toml::Value::Array(array) + milf::Value::Array(array) }}; } macro_rules! datetime { ($s:tt) => { - $s.parse::<toml::value::Datetime>().unwrap() + $s.parse::<milf::value::Datetime>().unwrap() }; } #[test] -fn test_cargo_toml() { +fn test_cargo_milf() { // Simple sanity check of: // // - Ordinary tables @@ -45,9 +45,9 @@ fn test_cargo_toml() { // - String values // - Table keys containing hyphen // - Table headers containing hyphen - let actual = toml! { + let actual = milf! { [package] - name = "toml" + name = "milf" version = "0.4.5" authors = ["Alex Crichton <alex@alexcrichton.com>"] @@ -64,7 +64,7 @@ fn test_cargo_toml() { let expected = table! { "package" => table! { - "name" => "toml".to_owned(), + "name" => "milf".to_owned(), "version" => "0.4.5".to_owned(), "authors" => array! { "Alex Crichton <alex@alexcrichton.com>".to_owned(), @@ -89,8 +89,8 @@ fn test_cargo_toml() { #[test] fn test_array() { - // Copied from the TOML spec. - let actual = toml! { + // Copied from the MILF spec. + let actual = milf! { [[fruit]] name = "apple" @@ -144,7 +144,7 @@ fn test_array() { #[test] fn test_number() { - let actual = toml! { + let actual = milf! { positive = 1 negative = -1 table = { positive = 1, negative = -1 } @@ -193,7 +193,7 @@ fn test_number() { #[test] fn test_nan() { - let actual = toml! { + let actual = milf! { sf4 = nan sf5 = +nan sf6 = -nan @@ -205,8 +205,8 @@ fn test_nan() { #[test] fn test_datetime() { - let actual = toml! { - // Copied from the TOML spec. + let actual = milf! { + // Copied from the MILF spec. odt1 = 1979-05-27T07:32:00Z odt2 = 1979-05-27T00:32:00-07:00 odt3 = 1979-05-27T00:32:00.999999-07:00 @@ -284,7 +284,7 @@ fn test_datetime() { // This test requires rustc >= 1.20. #[test] fn test_quoted_key() { - let actual = toml! { + let actual = milf! { "quoted" = true table = { "quoted" = true } @@ -311,7 +311,7 @@ fn test_quoted_key() { #[test] fn test_empty() { - let actual = toml! { + let actual = milf! { empty_inline_table = {} empty_inline_array = [] @@ -334,7 +334,7 @@ fn test_empty() { #[test] fn test_dotted_keys() { - let actual = toml! { + let actual = milf! { a.b = 123 a.c = 1979-05-27T07:32:00Z [table] diff --git a/test-suite/tests/parser.rs b/test-suite/tests/parser.rs index 169df79..0d14803 100644 --- a/test-suite/tests/parser.rs +++ b/test-suite/tests/parser.rs @@ -1,10 +1,10 @@ -extern crate toml; +extern crate milf; -use toml::Value; +use milf::Value; macro_rules! bad { - ($toml:expr, $msg:expr) => { - match $toml.parse::<toml::Value>() { + ($milf:expr, $msg:expr) => { + match $milf.parse::<milf::Value>() { Ok(s) => panic!("parsed to: {:#?}", s), Err(e) => assert_eq!(e.to_string(), $msg), } @@ -493,7 +493,7 @@ fn bad_underscores() { bad!("foo = 0__0", "invalid number at line 1 column 7"); bad!( "foo = __0", - "invalid TOML value, did you mean to use a quoted string? at line 1 column 7" + "invalid MILF value, did you mean to use a quoted string? at line 1 column 7" ); bad!("foo = 1_0_", "invalid number at line 1 column 7"); } @@ -540,19 +540,19 @@ fn booleans() { bad!( "foo = true2", - "invalid TOML value, did you mean to use a quoted string? at line 1 column 7" + "invalid MILF value, did you mean to use a quoted string? at line 1 column 7" ); bad!( "foo = false2", - "invalid TOML value, did you mean to use a quoted string? at line 1 column 7" + "invalid MILF value, did you mean to use a quoted string? at line 1 column 7" ); bad!( "foo = t1", - "invalid TOML value, did you mean to use a quoted string? at line 1 column 7" + "invalid MILF value, did you mean to use a quoted string? at line 1 column 7" ); bad!( "foo = f2", - "invalid TOML value, did you mean to use a quoted string? at line 1 column 7" + "invalid MILF value, did you mean to use a quoted string? at line 1 column 7" ); } @@ -643,8 +643,8 @@ fn datetimes() { macro_rules! t { ($actual:expr) => {{ let f = format!("foo = {}", $actual); - let toml = f.parse::<Value>().expect(&format!("failed: {}", f)); - assert_eq!(toml["foo"].as_datetime().unwrap().to_string(), $actual); + let milf = f.parse::<Value>().expect(&format!("failed: {}", f)); + assert_eq!(milf["foo"].as_datetime().unwrap().to_string(), $actual); }}; } diff --git a/test-suite/tests/pretty.rs b/test-suite/tests/pretty.rs index 0c65e0f..ee9f4f8 100644 --- a/test-suite/tests/pretty.rs +++ b/test-suite/tests/pretty.rs @@ -1,5 +1,5 @@ extern crate serde; -extern crate toml; +extern crate milf; use serde::ser::Serialize; @@ -13,31 +13,31 @@ text = \"\\nthis is the first line\\nthis is the second line\\n\" #[test] fn no_pretty() { - let toml = NO_PRETTY; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = NO_PRETTY; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); value - .serialize(&mut toml::Serializer::new(&mut result)) + .serialize(&mut milf::Serializer::new(&mut result)) .unwrap(); - println!("EXPECTED:\n{}", toml); + println!("EXPECTED:\n{}", milf); println!("\nRESULT:\n{}", result); - assert_eq!(toml, &result); + assert_eq!(milf, &result); } #[test] fn disable_pretty() { - let toml = NO_PRETTY; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = NO_PRETTY; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); { - let mut serializer = toml::Serializer::pretty(&mut result); + let mut serializer = milf::Serializer::pretty(&mut result); serializer.pretty_string(false); serializer.pretty_array(false); value.serialize(&mut serializer).unwrap(); } - println!("EXPECTED:\n{}", toml); + println!("EXPECTED:\n{}", milf); println!("\nRESULT:\n{}", result); - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const PRETTY_STD: &'static str = "\ @@ -57,15 +57,15 @@ this is the second line #[test] fn pretty_std() { - let toml = PRETTY_STD; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = PRETTY_STD; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); value - .serialize(&mut toml::Serializer::pretty(&mut result)) + .serialize(&mut milf::Serializer::pretty(&mut result)) .unwrap(); - println!("EXPECTED:\n{}", toml); + println!("EXPECTED:\n{}", milf); println!("\nRESULT:\n{}", result); - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const PRETTY_INDENT_2: &'static str = "\ @@ -90,16 +90,16 @@ three = [ #[test] fn pretty_indent_2() { - let toml = PRETTY_INDENT_2; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = PRETTY_INDENT_2; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); { - let mut serializer = toml::Serializer::pretty(&mut result); + let mut serializer = milf::Serializer::pretty(&mut result); serializer.pretty_array_indent(2); value.serialize(&mut serializer).unwrap(); } println!(">> Result:\n{}", result); - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const PRETTY_INDENT_2_OTHER: &'static str = "\ @@ -116,15 +116,15 @@ text = \"\\nthis is the first line\\nthis is the second line\\n\" #[test] /// Test pretty indent when gotten the other way fn pretty_indent_2_other() { - let toml = PRETTY_INDENT_2_OTHER; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = PRETTY_INDENT_2_OTHER; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); { - let mut serializer = toml::Serializer::new(&mut result); + let mut serializer = milf::Serializer::new(&mut result); serializer.pretty_array_indent(2); value.serialize(&mut serializer).unwrap(); } - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const PRETTY_ARRAY_NO_COMMA: &'static str = "\ @@ -140,15 +140,15 @@ text = \"\\nthis is the first line\\nthis is the second line\\n\" #[test] /// Test pretty indent when gotten the other way fn pretty_indent_array_no_comma() { - let toml = PRETTY_ARRAY_NO_COMMA; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = PRETTY_ARRAY_NO_COMMA; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); { - let mut serializer = toml::Serializer::new(&mut result); + let mut serializer = milf::Serializer::new(&mut result); serializer.pretty_array_trailing_comma(false); value.serialize(&mut serializer).unwrap(); } - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const PRETTY_NO_STRING: &'static str = "\ @@ -164,15 +164,15 @@ text = \"\\nthis is the first line\\nthis is the second line\\n\" #[test] /// Test pretty indent when gotten the other way fn pretty_no_string() { - let toml = PRETTY_NO_STRING; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = PRETTY_NO_STRING; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); { - let mut serializer = toml::Serializer::pretty(&mut result); + let mut serializer = milf::Serializer::pretty(&mut result); serializer.pretty_string(false); value.serialize(&mut serializer).unwrap(); } - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const PRETTY_TRICKY: &'static str = r##"[example] @@ -204,15 +204,15 @@ this is the fourth line #[test] fn pretty_tricky() { - let toml = PRETTY_TRICKY; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = PRETTY_TRICKY; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); value - .serialize(&mut toml::Serializer::pretty(&mut result)) + .serialize(&mut milf::Serializer::pretty(&mut result)) .unwrap(); - println!("EXPECTED:\n{}", toml); + println!("EXPECTED:\n{}", milf); println!("\nRESULT:\n{}", result); - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const PRETTY_TABLE_ARRAY: &'static str = r##"[[array]] @@ -230,15 +230,15 @@ single = 'this is a single line string' #[test] fn pretty_table_array() { - let toml = PRETTY_TABLE_ARRAY; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = PRETTY_TABLE_ARRAY; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); value - .serialize(&mut toml::Serializer::pretty(&mut result)) + .serialize(&mut milf::Serializer::pretty(&mut result)) .unwrap(); - println!("EXPECTED:\n{}", toml); + println!("EXPECTED:\n{}", milf); println!("\nRESULT:\n{}", result); - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const TABLE_ARRAY: &'static str = r##"[[array]] @@ -256,15 +256,15 @@ single = "this is a single line string" #[test] fn table_array() { - let toml = TABLE_ARRAY; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = TABLE_ARRAY; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); value - .serialize(&mut toml::Serializer::new(&mut result)) + .serialize(&mut milf::Serializer::new(&mut result)) .unwrap(); - println!("EXPECTED:\n{}", toml); + println!("EXPECTED:\n{}", milf); println!("\nRESULT:\n{}", result); - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const PRETTY_TRICKY_NON_LITERAL: &'static str = r##"[example] @@ -300,15 +300,15 @@ this is the fourth line #[test] fn pretty_tricky_non_literal() { - let toml = PRETTY_TRICKY_NON_LITERAL; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = PRETTY_TRICKY_NON_LITERAL; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); { - let mut serializer = toml::Serializer::pretty(&mut result); + let mut serializer = milf::Serializer::pretty(&mut result); serializer.pretty_string_literal(false); value.serialize(&mut serializer).unwrap(); } - println!("EXPECTED:\n{}", toml); + println!("EXPECTED:\n{}", milf); println!("\nRESULT:\n{}", result); - assert_eq!(toml, &result); + assert_eq!(milf, &result); } diff --git a/test-suite/tests/serde.rs b/test-suite/tests/serde.rs index 56172bd..712d2c5 100644 --- a/test-suite/tests/serde.rs +++ b/test-suite/tests/serde.rs @@ -1,15 +1,15 @@ extern crate serde; extern crate serde_json; -extern crate toml; +extern crate milf; #[macro_use] extern crate serde_derive; use serde::{Deserialize, Deserializer}; use std::collections::{BTreeMap, HashSet}; -use toml::map::Map; -use toml::Value; -use toml::Value::{Array, Float, Integer, Table}; +use milf::map::Map; +use milf::Value; +use milf::Value::{Array, Float, Integer, Table}; macro_rules! t { ($e:expr) => { @@ -21,38 +21,38 @@ macro_rules! t { } macro_rules! equivalent { - ($literal:expr, $toml:expr,) => {{ - let toml = $toml; + ($literal:expr, $milf:expr,) => {{ + let milf = $milf; let literal = $literal; // In/out of Value is equivalent println!("try_from"); - assert_eq!(t!(Value::try_from(literal.clone())), toml); + assert_eq!(t!(Value::try_from(literal.clone())), milf); println!("try_into"); - assert_eq!(literal, t!(toml.clone().try_into())); + assert_eq!(literal, t!(milf.clone().try_into())); // Through a string equivalent println!("to_string(literal)"); - assert_eq!(t!(toml::to_string(&literal)), toml.to_string()); - println!("to_string(toml)"); - assert_eq!(t!(toml::to_string(&toml)), toml.to_string()); - println!("literal, from_str(toml)"); - assert_eq!(literal, t!(toml::from_str(&toml.to_string()))); - println!("toml, from_str(toml)"); - assert_eq!(toml, t!(toml::from_str(&toml.to_string()))); + assert_eq!(t!(milf::to_string(&literal)), milf.to_string()); + println!("to_string(milf)"); + assert_eq!(t!(milf::to_string(&milf)), milf.to_string()); + println!("literal, from_str(milf)"); + assert_eq!(literal, t!(milf::from_str(&milf.to_string()))); + println!("milf, from_str(milf)"); + assert_eq!(milf, t!(milf::from_str(&milf.to_string()))); }}; } macro_rules! error { - ($ty:ty, $toml:expr, $msg_parse:expr, $msg_decode:expr) => {{ + ($ty:ty, $milf:expr, $msg_parse:expr, $msg_decode:expr) => {{ println!("attempting parsing"); - match toml::from_str::<$ty>(&$toml.to_string()) { + match milf::from_str::<$ty>(&$milf.to_string()) { Ok(_) => panic!("successful"), Err(e) => assert_eq!(e.to_string(), $msg_parse), } - println!("attempting toml decoding"); - match $toml.try_into::<$ty>() { + println!("attempting milf decoding"); + match $milf.try_into::<$ty>() { Ok(_) => panic!("successful"), Err(e) => assert_eq!(e.to_string(), $msg_decode), } @@ -376,7 +376,7 @@ fn parse_enum_string() { // })); // assert_eq!(v, t!(Deserialize::deserialize(&mut d))); // -// assert_eq!(d.toml, Some(Table(map! { +// assert_eq!(d.milf, Some(Table(map! { // b, Integer(5) // }))); // } @@ -397,7 +397,7 @@ fn parse_enum_string() { // })); // assert_eq!(v, t!(Deserialize::deserialize(&mut d))); // -// assert_eq!(d.toml, Some(Table(map! { +// assert_eq!(d.milf, Some(Table(map! { // a, Table(map! { // b, Integer(5) // }) @@ -419,7 +419,7 @@ fn parse_enum_string() { // })); // assert_eq!(v, t!(Deserialize::deserialize(&mut d))); // -// assert_eq!(d.toml, None); +// assert_eq!(d.milf, None); // } // // #[test] @@ -435,7 +435,7 @@ fn parse_enum_string() { // })); // assert_eq!(v, t!(Deserialize::deserialize(&mut d))); // -// assert_eq!(d.toml, None); +// assert_eq!(d.milf, None); // } // // #[test] @@ -449,7 +449,7 @@ fn parse_enum_string() { // })); // assert_eq!(v, t!(Deserialize::deserialize(&mut d))); // -// assert_eq!(d.toml, None); +// assert_eq!(d.milf, None); // } // // #[test] @@ -463,7 +463,7 @@ fn parse_enum_string() { // })); // assert_eq!(v, t!(Deserialize::deserialize(&mut d))); // -// assert_eq!(d.toml, None); +// assert_eq!(d.milf, None); // } // // #[test] @@ -482,7 +482,7 @@ fn parse_enum_string() { // })); // assert_eq!(v, t!(Deserialize::deserialize(&mut d))); // -// assert_eq!(d.toml, Some(Table(map! { +// assert_eq!(d.milf, Some(Table(map! { // a, Array(vec![Table(map! { // b, Integer(2) // })]) @@ -531,9 +531,9 @@ fn extra_keys() { a: isize, } - let toml = Table(map! { a: Integer(2), b: Integer(2) }); - assert!(toml.clone().try_into::<Foo>().is_ok()); - assert!(toml::from_str::<Foo>(&toml.to_string()).is_ok()); + let milf = Table(map! { a: Integer(2), b: Integer(2) }); + assert!(milf.clone().try_into::<Foo>().is_ok()); + assert!(milf::from_str::<Foo>(&milf.to_string()).is_ok()); } #[test] @@ -590,7 +590,7 @@ struct CanBeEmpty { #[test] fn table_structs_empty() { let text = "[bar]\n\n[baz]\n\n[bazv]\na = \"foo\"\n\n[foo]\n"; - let value: BTreeMap<String, CanBeEmpty> = toml::from_str(text).unwrap(); + let value: BTreeMap<String, CanBeEmpty> = milf::from_str(text).unwrap(); let mut expected: BTreeMap<String, CanBeEmpty> = BTreeMap::new(); expected.insert("bar".to_string(), CanBeEmpty::default()); expected.insert("baz".to_string(), CanBeEmpty::default()); @@ -603,7 +603,7 @@ fn table_structs_empty() { ); expected.insert("foo".to_string(), CanBeEmpty::default()); assert_eq!(value, expected); - assert_eq!(toml::to_string(&value).unwrap(), text); + assert_eq!(milf::to_string(&value).unwrap(), text); } #[test] @@ -671,7 +671,7 @@ fn homogeneous_tuple_struct() { fn json_interoperability() { #[derive(Serialize, Deserialize)] struct Foo { - any: toml::Value, + any: milf::Value, } let _foo: Foo = serde_json::from_str( diff --git a/test-suite/tests/spanned-impls.rs b/test-suite/tests/spanned-impls.rs index cb12b1a..eb95673 100644 --- a/test-suite/tests/spanned-impls.rs +++ b/test-suite/tests/spanned-impls.rs @@ -1,5 +1,5 @@ use std::cmp::{Ord, Ordering, PartialOrd}; -use toml::{from_str, Spanned}; +use milf::{from_str, Spanned}; #[macro_use] extern crate serde_derive; diff --git a/test-suite/tests/spanned.rs b/test-suite/tests/spanned.rs index d8f7a12..a8d29d4 100644 --- a/test-suite/tests/spanned.rs +++ b/test-suite/tests/spanned.rs @@ -1,12 +1,12 @@ extern crate serde; -extern crate toml; +extern crate milf; #[macro_use] extern crate serde_derive; use std::collections::HashMap; use std::fmt::Debug; -use toml::value::Datetime; -use toml::Spanned; +use milf::value::Datetime; +use milf::Spanned; /// A set of good datetimes. pub fn good_datetimes() -> Vec<&'static str> { @@ -41,7 +41,7 @@ fn test_spanned_field() { where T: serde::Deserialize<'de> + Debug + PartialEq, { - let foo: Foo<T> = toml::from_str(s).unwrap(); + let foo: Foo<T> = milf::from_str(s).unwrap(); assert_eq!(6, foo.foo.start()); if let Some(end) = end { @@ -52,7 +52,7 @@ fn test_spanned_field() { assert_eq!(expected, &s[foo.foo.start()..foo.foo.end()]); // Test for Spanned<> at the top level - let foo_outer: Spanned<BareFoo<T>> = toml::from_str(s).unwrap(); + let foo_outer: Spanned<BareFoo<T>> = milf::from_str(s).unwrap(); assert_eq!(0, foo_outer.start()); assert_eq!(s.len(), foo_outer.end()); @@ -94,13 +94,13 @@ fn test_inner_spanned_table() { } fn good(s: &str, zero: bool) { - let foo: Foo = toml::from_str(s).unwrap(); + let foo: Foo = milf::from_str(s).unwrap(); if zero { assert_eq!(foo.foo.start(), 0); // We'd actually have to assert equality with s.len() here, // but the current implementation doesn't support that, - // and it's not possible with toml's data format to support it + // and it's not possible with milf's data format to support it // in the general case as spans aren't always well-defined. // So this check mainly serves as a reminder that this test should // be updated *if* one day there is support for emitting the actual span. @@ -141,7 +141,7 @@ fn test_outer_spanned_table() { } fn good(s: &str) { - let foo: Foo = toml::from_str(s).unwrap(); + let foo: Foo = milf::from_str(s).unwrap(); for (k, v) in foo.foo.iter() { assert_eq!(&s[k.start()..k.end()], k.get_ref()); @@ -174,7 +174,7 @@ fn test_spanned_nested() { } fn good(s: &str) { - let foo: Foo = toml::from_str(s).unwrap(); + let foo: Foo = milf::from_str(s).unwrap(); for (k, v) in foo.foo.iter() { assert_eq!(&s[k.start()..k.end()], k.get_ref()); @@ -214,13 +214,13 @@ fn test_spanned_array() { } fn good(s: &str) { - let foo_list: Foo = toml::from_str(s).unwrap(); + let foo_list: Foo = milf::from_str(s).unwrap(); for foo in foo_list.foo.iter() { assert_eq!(foo.start(), 0); // We'd actually have to assert equality with s.len() here, // but the current implementation doesn't support that, - // and it's not possible with toml's data format to support it + // and it's not possible with milf's data format to support it // in the general case as spans aren't always well-defined. // So this check mainly serves as a reminder that this test should // be updated *if* one day there is support for emitting the actual span. diff --git a/test-suite/tests/tables-last.rs b/test-suite/tests/tables-last.rs index b885a42..ae427e4 100644 --- a/test-suite/tests/tables-last.rs +++ b/test-suite/tests/tables-last.rs @@ -1,12 +1,12 @@ #[macro_use] extern crate serde_derive; -extern crate toml; +extern crate milf; use std::collections::HashMap; #[derive(Serialize)] struct A { - #[serde(serialize_with = "toml::ser::tables_last")] + #[serde(serialize_with = "milf::ser::tables_last")] vals: HashMap<&'static str, Value>, } @@ -28,5 +28,5 @@ fn always_works() { sub.insert("foo", "bar"); a.vals.insert("bar", Value::Map(sub)); - toml::to_string(&a).unwrap(); + milf::to_string(&a).unwrap(); } diff --git a/test-suite/tests/valid.rs b/test-suite/tests/valid.rs index 0745cc8..ddbaf1b 100644 --- a/test-suite/tests/valid.rs +++ b/test-suite/tests/valid.rs @@ -1,12 +1,12 @@ extern crate serde; extern crate serde_json; -extern crate toml; +extern crate milf; use serde::ser::Serialize; use serde_json::Value as Json; -use toml::{to_string_pretty, Value as Toml}; +use milf::{to_string_pretty, Value as Milf}; -fn to_json(toml: toml::Value) -> Json { +fn to_json(milf: milf::Value) -> Json { fn doit(s: &str, json: Json) -> Json { let mut map = serde_json::Map::new(); map.insert("type".to_string(), Json::String(s.to_string())); @@ -14,10 +14,10 @@ fn to_json(toml: toml::Value) -> Json { Json::Object(map) } - match toml { - Toml::String(s) => doit("string", Json::String(s)), - Toml::Integer(i) => doit("integer", Json::String(i.to_string())), - Toml::Float(f) => doit( + match milf { + Milf::String(s) => doit("string", Json::String(s)), + Milf::Integer(i) => doit("integer", Json::String(i.to_string())), + Milf::Float(f) => doit( "float", Json::String({ let s = format!("{:.15}", f); @@ -29,11 +29,11 @@ fn to_json(toml: toml::Value) -> Json { } }), ), - Toml::Boolean(b) => doit("bool", Json::String(format!("{}", b))), - Toml::Datetime(s) => doit("datetime", Json::String(s.to_string())), - Toml::Array(arr) => { + Milf::Boolean(b) => doit("bool", Json::String(format!("{}", b))), + Milf::Datetime(s) => doit("datetime", Json::String(s.to_string())), + Milf::Array(arr) => { let is_table = match arr.first() { - Some(&Toml::Table(..)) => true, + Some(&Milf::Table(..)) => true, _ => false, }; let json = Json::Array(arr.into_iter().map(to_json).collect()); @@ -43,7 +43,7 @@ fn to_json(toml: toml::Value) -> Json { doit("array", json) } } - Toml::Table(table) => { + Milf::Table(table) => { let mut map = serde_json::Map::new(); for (k, v) in table { map.insert(k, to_json(v)); @@ -53,345 +53,345 @@ fn to_json(toml: toml::Value) -> Json { } } -fn run_pretty(toml: Toml) { - // Assert toml == json +fn run_pretty(milf: Milf) { + // Assert milf == json println!("### pretty round trip parse."); // standard pretty - let toml_raw = to_string_pretty(&toml).expect("to string"); - let toml2 = toml_raw.parse().expect("from string"); - assert_eq!(toml, toml2); + let milf_raw = to_string_pretty(&milf).expect("to string"); + let milf2 = milf_raw.parse().expect("from string"); + assert_eq!(milf, milf2); // pretty with indent 2 let mut result = String::with_capacity(128); { - let mut serializer = toml::Serializer::pretty(&mut result); + let mut serializer = milf::Serializer::pretty(&mut result); serializer.pretty_array_indent(2); - toml.serialize(&mut serializer).expect("to string"); + milf.serialize(&mut serializer).expect("to string"); } - assert_eq!(toml, result.parse().expect("from str")); + assert_eq!(milf, result.parse().expect("from str")); result.clear(); { - let mut serializer = toml::Serializer::new(&mut result); + let mut serializer = milf::Serializer::new(&mut result); serializer.pretty_array_trailing_comma(false); - toml.serialize(&mut serializer).expect("to string"); + milf.serialize(&mut serializer).expect("to string"); } - assert_eq!(toml, result.parse().expect("from str")); + assert_eq!(milf, result.parse().expect("from str")); result.clear(); { - let mut serializer = toml::Serializer::pretty(&mut result); + let mut serializer = milf::Serializer::pretty(&mut result); serializer.pretty_string(false); - toml.serialize(&mut serializer).expect("to string"); - assert_eq!(toml, toml2); + milf.serialize(&mut serializer).expect("to string"); + assert_eq!(milf, milf2); } - assert_eq!(toml, result.parse().expect("from str")); + assert_eq!(milf, result.parse().expect("from str")); result.clear(); { - let mut serializer = toml::Serializer::pretty(&mut result); + let mut serializer = milf::Serializer::pretty(&mut result); serializer.pretty_array(false); - toml.serialize(&mut serializer).expect("to string"); - assert_eq!(toml, toml2); + milf.serialize(&mut serializer).expect("to string"); + assert_eq!(milf, milf2); } - assert_eq!(toml, result.parse().expect("from str")); + assert_eq!(milf, result.parse().expect("from str")); } -fn run(toml_raw: &str, json_raw: &str) { - println!("parsing:\n{}", toml_raw); - let toml: Toml = toml_raw.parse().unwrap(); +fn run(milf_raw: &str, json_raw: &str) { + println!("parsing:\n{}", milf_raw); + let milf: Milf = milf_raw.parse().unwrap(); let json: Json = json_raw.parse().unwrap(); - // Assert toml == json - let toml_json = to_json(toml.clone()); + // Assert milf == json + let milf_json = to_json(milf.clone()); assert!( - json == toml_json, + json == milf_json, "expected\n{}\ngot\n{}\n", serde_json::to_string_pretty(&json).unwrap(), - serde_json::to_string_pretty(&toml_json).unwrap() + serde_json::to_string_pretty(&milf_json).unwrap() ); // Assert round trip - println!("round trip parse: {}", toml); - let toml2 = toml.to_string().parse().unwrap(); - assert_eq!(toml, toml2); - run_pretty(toml); + println!("round trip parse: {}", milf); + let milf2 = milf.to_string().parse().unwrap(); + assert_eq!(milf, milf2); + run_pretty(milf); } -macro_rules! test( ($name:ident, $toml:expr, $json:expr) => ( +macro_rules! test( ($name:ident, $milf:expr, $json:expr) => ( #[test] - fn $name() { run($toml, $json); } + fn $name() { run($milf, $json); } ) ); test!( array_empty, - include_str!("valid/array-empty.toml"), + include_str!("valid/array-empty.milf"), include_str!("valid/array-empty.json") ); test!( array_nospaces, - include_str!("valid/array-nospaces.toml"), + include_str!("valid/array-nospaces.milf"), include_str!("valid/array-nospaces.json") ); test!( arrays_hetergeneous, - include_str!("valid/arrays-hetergeneous.toml"), + include_str!("valid/arrays-hetergeneous.milf"), include_str!("valid/arrays-hetergeneous.json") ); test!( arrays, - include_str!("valid/arrays.toml"), + include_str!("valid/arrays.milf"), include_str!("valid/arrays.json") ); test!( arrays_nested, - include_str!("valid/arrays-nested.toml"), + include_str!("valid/arrays-nested.milf"), include_str!("valid/arrays-nested.json") ); test!( array_mixed_types_ints_and_floats, - include_str!("valid/array-mixed-types-ints-and-floats.toml"), + include_str!("valid/array-mixed-types-ints-and-floats.milf"), include_str!("valid/array-mixed-types-ints-and-floats.json") ); test!( array_mixed_types_arrays_and_ints, - include_str!("valid/array-mixed-types-arrays-and-ints.toml"), + include_str!("valid/array-mixed-types-arrays-and-ints.milf"), include_str!("valid/array-mixed-types-arrays-and-ints.json") ); test!( array_mixed_types_strings_and_ints, - include_str!("valid/array-mixed-types-strings-and-ints.toml"), + include_str!("valid/array-mixed-types-strings-and-ints.milf"), include_str!("valid/array-mixed-types-strings-and-ints.json") ); test!( empty, - include_str!("valid/empty.toml"), + include_str!("valid/empty.milf"), include_str!("valid/empty.json") ); test!( bool, - include_str!("valid/bool.toml"), + include_str!("valid/bool.milf"), include_str!("valid/bool.json") ); test!( comments_everywhere, - include_str!("valid/comments-everywhere.toml"), + include_str!("valid/comments-everywhere.milf"), include_str!("valid/comments-everywhere.json") ); test!( datetime, - include_str!("valid/datetime.toml"), + include_str!("valid/datetime.milf"), include_str!("valid/datetime.json") ); test!( example, - include_str!("valid/example.toml"), + include_str!("valid/example.milf"), include_str!("valid/example.json") ); test!( float, - include_str!("valid/float.toml"), + include_str!("valid/float.milf"), include_str!("valid/float.json") ); test!( implicit_and_explicit_after, - include_str!("valid/implicit-and-explicit-after.toml"), + include_str!("valid/implicit-and-explicit-after.milf"), include_str!("valid/implicit-and-explicit-after.json") ); test!( implicit_and_explicit_before, - include_str!("valid/implicit-and-explicit-before.toml"), + include_str!("valid/implicit-and-explicit-before.milf"), include_str!("valid/implicit-and-explicit-before.json") ); test!( implicit_groups, - include_str!("valid/implicit-groups.toml"), + include_str!("valid/implicit-groups.milf"), include_str!("valid/implicit-groups.json") ); test!( integer, - include_str!("valid/integer.toml"), + include_str!("valid/integer.milf"), include_str!("valid/integer.json") ); test!( key_equals_nospace, - include_str!("valid/key-equals-nospace.toml"), + include_str!("valid/key-equals-nospace.milf"), include_str!("valid/key-equals-nospace.json") ); test!( key_space, - include_str!("valid/key-space.toml"), + include_str!("valid/key-space.milf"), include_str!("valid/key-space.json") ); test!( key_special_chars, - include_str!("valid/key-special-chars.toml"), + include_str!("valid/key-special-chars.milf"), include_str!("valid/key-special-chars.json") ); test!( key_with_pound, - include_str!("valid/key-with-pound.toml"), + include_str!("valid/key-with-pound.milf"), include_str!("valid/key-with-pound.json") ); test!( long_float, - include_str!("valid/long-float.toml"), + include_str!("valid/long-float.milf"), include_str!("valid/long-float.json") ); test!( long_integer, - include_str!("valid/long-integer.toml"), + include_str!("valid/long-integer.milf"), include_str!("valid/long-integer.json") ); test!( multiline_string, - include_str!("valid/multiline-string.toml"), + include_str!("valid/multiline-string.milf"), include_str!("valid/multiline-string.json") ); test!( raw_multiline_string, - include_str!("valid/raw-multiline-string.toml"), + include_str!("valid/raw-multiline-string.milf"), include_str!("valid/raw-multiline-string.json") ); test!( raw_string, - include_str!("valid/raw-string.toml"), + include_str!("valid/raw-string.milf"), include_str!("valid/raw-string.json") ); test!( string_empty, - include_str!("valid/string-empty.toml"), + include_str!("valid/string-empty.milf"), include_str!("valid/string-empty.json") ); test!( string_escapes, - include_str!("valid/string-escapes.toml"), + include_str!("valid/string-escapes.milf"), include_str!("valid/string-escapes.json") ); test!( string_simple, - include_str!("valid/string-simple.toml"), + include_str!("valid/string-simple.milf"), include_str!("valid/string-simple.json") ); test!( string_with_pound, - include_str!("valid/string-with-pound.toml"), + include_str!("valid/string-with-pound.milf"), include_str!("valid/string-with-pound.json") ); test!( table_array_implicit, - include_str!("valid/table-array-implicit.toml"), + include_str!("valid/table-array-implicit.milf"), include_str!("valid/table-array-implicit.json") ); test!( table_array_many, - include_str!("valid/table-array-many.toml"), + include_str!("valid/table-array-many.milf"), include_str!("valid/table-array-many.json") ); test!( table_array_nest, - include_str!("valid/table-array-nest.toml"), + include_str!("valid/table-array-nest.milf"), include_str!("valid/table-array-nest.json") ); test!( table_array_one, - include_str!("valid/table-array-one.toml"), + include_str!("valid/table-array-one.milf"), include_str!("valid/table-array-one.json") ); test!( table_empty, - include_str!("valid/table-empty.toml"), + include_str!("valid/table-empty.milf"), include_str!("valid/table-empty.json") ); test!( table_sub_empty, - include_str!("valid/table-sub-empty.toml"), + include_str!("valid/table-sub-empty.milf"), include_str!("valid/table-sub-empty.json") ); test!( table_multi_empty, - include_str!("valid/table-multi-empty.toml"), + include_str!("valid/table-multi-empty.milf"), include_str!("valid/table-multi-empty.json") ); test!( table_whitespace, - include_str!("valid/table-whitespace.toml"), + include_str!("valid/table-whitespace.milf"), include_str!("valid/table-whitespace.json") ); test!( table_with_pound, - include_str!("valid/table-with-pound.toml"), + include_str!("valid/table-with-pound.milf"), include_str!("valid/table-with-pound.json") ); test!( unicode_escape, - include_str!("valid/unicode-escape.toml"), + include_str!("valid/unicode-escape.milf"), include_str!("valid/unicode-escape.json") ); test!( unicode_literal, - include_str!("valid/unicode-literal.toml"), + include_str!("valid/unicode-literal.milf"), include_str!("valid/unicode-literal.json") ); test!( hard_example, - include_str!("valid/hard_example.toml"), + include_str!("valid/hard_example.milf"), include_str!("valid/hard_example.json") ); test!( example2, - include_str!("valid/example2.toml"), + include_str!("valid/example2.milf"), include_str!("valid/example2.json") ); test!( example3, - include_str!("valid/example-v0.3.0.toml"), + include_str!("valid/example-v0.3.0.milf"), include_str!("valid/example-v0.3.0.json") ); test!( example4, - include_str!("valid/example-v0.4.0.toml"), + include_str!("valid/example-v0.4.0.milf"), include_str!("valid/example-v0.4.0.json") ); test!( example_bom, - include_str!("valid/example-bom.toml"), + include_str!("valid/example-bom.milf"), include_str!("valid/example.json") ); test!( datetime_truncate, - include_str!("valid/datetime-truncate.toml"), + include_str!("valid/datetime-truncate.milf"), include_str!("valid/datetime-truncate.json") ); test!( key_quote_newline, - include_str!("valid/key-quote-newline.toml"), + include_str!("valid/key-quote-newline.milf"), include_str!("valid/key-quote-newline.json") ); test!( table_array_nest_no_keys, - include_str!("valid/table-array-nest-no-keys.toml"), + include_str!("valid/table-array-nest-no-keys.milf"), include_str!("valid/table-array-nest-no-keys.json") ); test!( dotted_keys, - include_str!("valid/dotted-keys.toml"), + include_str!("valid/dotted-keys.milf"), include_str!("valid/dotted-keys.json") ); test!( quote_surrounded_value, - include_str!("valid/quote-surrounded-value.toml"), + include_str!("valid/quote-surrounded-value.milf"), include_str!("valid/quote-surrounded-value.json") ); test!( float_exponent, - include_str!("valid/float-exponent.toml"), + include_str!("valid/float-exponent.milf"), include_str!("valid/float-exponent.json") ); test!( string_delim_end, - include_str!("valid/string-delim-end.toml"), + include_str!("valid/string-delim-end.milf"), include_str!("valid/string-delim-end.json") ); diff --git a/test-suite/tests/valid/array-empty.toml b/test-suite/tests/valid/array-empty.milf index fa58dc6..fa58dc6 100644 --- a/test-suite/tests/valid/array-empty.toml +++ b/test-suite/tests/valid/array-empty.milf diff --git a/test-suite/tests/valid/array-mixed-types-arrays-and-ints.toml b/test-suite/tests/valid/array-mixed-types-arrays-and-ints.milf index 051ec73..051ec73 100644 --- a/test-suite/tests/valid/array-mixed-types-arrays-and-ints.toml +++ b/test-suite/tests/valid/array-mixed-types-arrays-and-ints.milf diff --git a/test-suite/tests/valid/array-mixed-types-ints-and-floats.toml b/test-suite/tests/valid/array-mixed-types-ints-and-floats.milf index a5aa9b7..a5aa9b7 100644 --- a/test-suite/tests/valid/array-mixed-types-ints-and-floats.toml +++ b/test-suite/tests/valid/array-mixed-types-ints-and-floats.milf diff --git a/test-suite/tests/valid/array-mixed-types-strings-and-ints.toml b/test-suite/tests/valid/array-mixed-types-strings-and-ints.milf index f348308..f348308 100644 --- a/test-suite/tests/valid/array-mixed-types-strings-and-ints.toml +++ b/test-suite/tests/valid/array-mixed-types-strings-and-ints.milf diff --git a/test-suite/tests/valid/array-nospaces.toml b/test-suite/tests/valid/array-nospaces.milf index 6618936..6618936 100644 --- a/test-suite/tests/valid/array-nospaces.toml +++ b/test-suite/tests/valid/array-nospaces.milf diff --git a/test-suite/tests/valid/arrays-hetergeneous.toml b/test-suite/tests/valid/arrays-hetergeneous.milf index a246fcf..a246fcf 100644 --- a/test-suite/tests/valid/arrays-hetergeneous.toml +++ b/test-suite/tests/valid/arrays-hetergeneous.milf diff --git a/test-suite/tests/valid/arrays-nested.toml b/test-suite/tests/valid/arrays-nested.milf index ce33022..ce33022 100644 --- a/test-suite/tests/valid/arrays-nested.toml +++ b/test-suite/tests/valid/arrays-nested.milf diff --git a/test-suite/tests/valid/arrays.toml b/test-suite/tests/valid/arrays.milf index c435f57..c435f57 100644 --- a/test-suite/tests/valid/arrays.toml +++ b/test-suite/tests/valid/arrays.milf diff --git a/test-suite/tests/valid/bool.toml b/test-suite/tests/valid/bool.milf index a8a829b..a8a829b 100644 --- a/test-suite/tests/valid/bool.toml +++ b/test-suite/tests/valid/bool.milf diff --git a/test-suite/tests/valid/comments-everywhere.toml b/test-suite/tests/valid/comments-everywhere.milf index 3dca74c..3dca74c 100644 --- a/test-suite/tests/valid/comments-everywhere.toml +++ b/test-suite/tests/valid/comments-everywhere.milf diff --git a/test-suite/tests/valid/datetime-truncate.toml b/test-suite/tests/valid/datetime-truncate.milf index 05de841..05de841 100644 --- a/test-suite/tests/valid/datetime-truncate.toml +++ b/test-suite/tests/valid/datetime-truncate.milf diff --git a/test-suite/tests/valid/datetime.toml b/test-suite/tests/valid/datetime.milf index 2e99340..2e99340 100644 --- a/test-suite/tests/valid/datetime.toml +++ b/test-suite/tests/valid/datetime.milf diff --git a/test-suite/tests/valid/dotted-keys.toml b/test-suite/tests/valid/dotted-keys.milf index 234d64c..234d64c 100644 --- a/test-suite/tests/valid/dotted-keys.toml +++ b/test-suite/tests/valid/dotted-keys.milf diff --git a/test-suite/tests/valid/empty.toml b/test-suite/tests/valid/empty.milf index e69de29..e69de29 100644 --- a/test-suite/tests/valid/empty.toml +++ b/test-suite/tests/valid/empty.milf diff --git a/test-suite/tests/valid/example-bom.toml b/test-suite/tests/valid/example-bom.milf index fb5ac81..fb5ac81 100644 --- a/test-suite/tests/valid/example-bom.toml +++ b/test-suite/tests/valid/example-bom.milf diff --git a/test-suite/tests/valid/example-v0.3.0.toml b/test-suite/tests/valid/example-v0.3.0.milf index 76aacc3..dff4c8a 100644 --- a/test-suite/tests/valid/example-v0.3.0.toml +++ b/test-suite/tests/valid/example-v0.3.0.milf @@ -14,7 +14,7 @@ key = "value" # Yeah, you can do this. [dog.tater] type = "pug" -# You don't need to specify all the super-tables if you don't want to. TOML knows how to do it for you. +# You don't need to specify all the super-tables if you don't want to. MILF knows how to do it for you. # [x] you # [x.y] don't diff --git a/test-suite/tests/valid/example-v0.4.0.toml b/test-suite/tests/valid/example-v0.4.0.milf index 69f1c1b..061e3c8 100644 --- a/test-suite/tests/valid/example-v0.4.0.toml +++ b/test-suite/tests/valid/example-v0.4.0.milf @@ -22,7 +22,7 @@ key = "value" # Yeah, you can do this. key = "another value" -# You don't need to specify all the super-tables if you don't want to. TOML +# You don't need to specify all the super-tables if you don't want to. MILF # knows how to do it for you. # [x] you diff --git a/test-suite/tests/valid/example.toml b/test-suite/tests/valid/example.milf index 8cb02e0..8cb02e0 100644 --- a/test-suite/tests/valid/example.toml +++ b/test-suite/tests/valid/example.milf diff --git a/test-suite/tests/valid/example2.json b/test-suite/tests/valid/example2.json index 3249a97..5471d7f 100644 --- a/test-suite/tests/valid/example2.json +++ b/test-suite/tests/valid/example2.json @@ -1 +1 @@ -{"clients":{"data":{"type":"array","value":[{"type":"array","value":[{"type":"string","value":"gamma"},{"type":"string","value":"delta"}]},{"type":"array","value":[{"type":"integer","value":"1"},{"type":"integer","value":"2"}]}]},"hosts":{"type":"array","value":[{"type":"string","value":"alpha"},{"type":"string","value":"omega"}]}},"database":{"connection_max":{"type":"integer","value":"5000"},"enabled":{"type":"bool","value":"true"},"ports":{"type":"array","value":[{"type":"integer","value":"8001"},{"type":"integer","value":"8001"},{"type":"integer","value":"8002"}]},"server":{"type":"string","value":"192.168.1.1"}},"owner":{"bio":{"type":"string","value":"GitHub Cofounder \u0026 CEO\nLikes tater tots and beer."},"dob":{"type":"datetime","value":"1979-05-27T07:32:00Z"},"name":{"type":"string","value":"Tom Preston-Werner"},"organization":{"type":"string","value":"GitHub"}},"products":[{"name":{"type":"string","value":"Hammer"},"sku":{"type":"integer","value":"738594937"}},{"color":{"type":"string","value":"gray"},"name":{"type":"string","value":"Nail"},"sku":{"type":"integer","value":"284758393"}}],"servers":{"alpha":{"dc":{"type":"string","value":"eqdc10"},"ip":{"type":"string","value":"10.0.0.1"}},"beta":{"country":{"type":"string","value":"中国"},"dc":{"type":"string","value":"eqdc10"},"ip":{"type":"string","value":"10.0.0.2"}}},"title":{"type":"string","value":"TOML Example"}} +{"clients":{"data":{"type":"array","value":[{"type":"array","value":[{"type":"string","value":"gamma"},{"type":"string","value":"delta"}]},{"type":"array","value":[{"type":"integer","value":"1"},{"type":"integer","value":"2"}]}]},"hosts":{"type":"array","value":[{"type":"string","value":"alpha"},{"type":"string","value":"omega"}]}},"database":{"connection_max":{"type":"integer","value":"5000"},"enabled":{"type":"bool","value":"true"},"ports":{"type":"array","value":[{"type":"integer","value":"8001"},{"type":"integer","value":"8001"},{"type":"integer","value":"8002"}]},"server":{"type":"string","value":"192.168.1.1"}},"owner":{"bio":{"type":"string","value":"GitHub Cofounder \u0026 CEO\nLikes tater tots and beer."},"dob":{"type":"datetime","value":"1979-05-27T07:32:00Z"},"name":{"type":"string","value":"Tom Preston-Werner"},"organization":{"type":"string","value":"GitHub"}},"products":[{"name":{"type":"string","value":"Hammer"},"sku":{"type":"integer","value":"738594937"}},{"color":{"type":"string","value":"gray"},"name":{"type":"string","value":"Nail"},"sku":{"type":"integer","value":"284758393"}}],"servers":{"alpha":{"dc":{"type":"string","value":"eqdc10"},"ip":{"type":"string","value":"10.0.0.1"}},"beta":{"country":{"type":"string","value":"中国"},"dc":{"type":"string","value":"eqdc10"},"ip":{"type":"string","value":"10.0.0.2"}}},"title":{"type":"string","value":"MILF Example"}} diff --git a/test-suite/tests/valid/example2.toml b/test-suite/tests/valid/example2.milf index bc12c99..75b138c 100644 --- a/test-suite/tests/valid/example2.toml +++ b/test-suite/tests/valid/example2.milf @@ -1,6 +1,6 @@ -# This is a TOML document. Boom. +# This is a MILF document. Boom. -title = "TOML Example" +title = "MILF Example" [owner] name = "Tom Preston-Werner" @@ -16,7 +16,7 @@ enabled = true [servers] - # You can indent as you please. Tabs or spaces. TOML don't care. + # You can indent as you please. Tabs or spaces. MILF don't care. [servers.alpha] ip = "10.0.0.1" dc = "eqdc10" diff --git a/test-suite/tests/valid/float-exponent.toml b/test-suite/tests/valid/float-exponent.milf index 5349db3..5349db3 100644 --- a/test-suite/tests/valid/float-exponent.toml +++ b/test-suite/tests/valid/float-exponent.milf diff --git a/test-suite/tests/valid/float.toml b/test-suite/tests/valid/float.milf index 7c528d2..7c528d2 100644 --- a/test-suite/tests/valid/float.toml +++ b/test-suite/tests/valid/float.milf diff --git a/test-suite/tests/valid/hard_example.toml b/test-suite/tests/valid/hard_example.milf index 38856c8..d2181ec 100644 --- a/test-suite/tests/valid/hard_example.toml +++ b/test-suite/tests/valid/hard_example.milf @@ -1,5 +1,5 @@ -# Test file for TOML -# Only this one tries to emulate a TOML file written by a user of the kind of parser writers probably hate +# Test file for MILF +# Only this one tries to emulate a MILF file written by a user of the kind of parser writers probably hate # This part you'll really hate [the] diff --git a/test-suite/tests/valid/implicit-and-explicit-after.toml b/test-suite/tests/valid/implicit-and-explicit-after.milf index c0e8865..c0e8865 100644 --- a/test-suite/tests/valid/implicit-and-explicit-after.toml +++ b/test-suite/tests/valid/implicit-and-explicit-after.milf diff --git a/test-suite/tests/valid/implicit-and-explicit-before.toml b/test-suite/tests/valid/implicit-and-explicit-before.milf index eee68ff..eee68ff 100644 --- a/test-suite/tests/valid/implicit-and-explicit-before.toml +++ b/test-suite/tests/valid/implicit-and-explicit-before.milf diff --git a/test-suite/tests/valid/implicit-groups.toml b/test-suite/tests/valid/implicit-groups.milf index b6333e4..b6333e4 100644 --- a/test-suite/tests/valid/implicit-groups.toml +++ b/test-suite/tests/valid/implicit-groups.milf diff --git a/test-suite/tests/valid/integer.toml b/test-suite/tests/valid/integer.milf index 8362459..8362459 100644 --- a/test-suite/tests/valid/integer.toml +++ b/test-suite/tests/valid/integer.milf diff --git a/test-suite/tests/valid/key-equals-nospace.toml b/test-suite/tests/valid/key-equals-nospace.milf index 560901c..560901c 100644 --- a/test-suite/tests/valid/key-equals-nospace.toml +++ b/test-suite/tests/valid/key-equals-nospace.milf diff --git a/test-suite/tests/valid/key-quote-newline.toml b/test-suite/tests/valid/key-quote-newline.milf index a2639bf..a2639bf 100644 --- a/test-suite/tests/valid/key-quote-newline.toml +++ b/test-suite/tests/valid/key-quote-newline.milf diff --git a/test-suite/tests/valid/key-space.toml b/test-suite/tests/valid/key-space.milf index f4f36c4..f4f36c4 100644 --- a/test-suite/tests/valid/key-space.toml +++ b/test-suite/tests/valid/key-space.milf diff --git a/test-suite/tests/valid/key-special-chars.toml b/test-suite/tests/valid/key-special-chars.milf index dc43625..dc43625 100644 --- a/test-suite/tests/valid/key-special-chars.toml +++ b/test-suite/tests/valid/key-special-chars.milf diff --git a/test-suite/tests/valid/key-with-pound.toml b/test-suite/tests/valid/key-with-pound.milf index 65b766f..65b766f 100644 --- a/test-suite/tests/valid/key-with-pound.toml +++ b/test-suite/tests/valid/key-with-pound.milf diff --git a/test-suite/tests/valid/long-float.toml b/test-suite/tests/valid/long-float.milf index 9558ae4..9558ae4 100644 --- a/test-suite/tests/valid/long-float.toml +++ b/test-suite/tests/valid/long-float.milf diff --git a/test-suite/tests/valid/long-integer.toml b/test-suite/tests/valid/long-integer.milf index 424a13a..424a13a 100644 --- a/test-suite/tests/valid/long-integer.toml +++ b/test-suite/tests/valid/long-integer.milf diff --git a/test-suite/tests/valid/multiline-string.toml b/test-suite/tests/valid/multiline-string.milf index 2c4237f..2c4237f 100644 --- a/test-suite/tests/valid/multiline-string.toml +++ b/test-suite/tests/valid/multiline-string.milf diff --git a/test-suite/tests/valid/quote-surrounded-value.toml b/test-suite/tests/valid/quote-surrounded-value.milf index dc8697e..dc8697e 100644 --- a/test-suite/tests/valid/quote-surrounded-value.toml +++ b/test-suite/tests/valid/quote-surrounded-value.milf diff --git a/test-suite/tests/valid/raw-multiline-string.toml b/test-suite/tests/valid/raw-multiline-string.milf index 8094c03..8094c03 100644 --- a/test-suite/tests/valid/raw-multiline-string.toml +++ b/test-suite/tests/valid/raw-multiline-string.milf diff --git a/test-suite/tests/valid/raw-string.toml b/test-suite/tests/valid/raw-string.milf index 92acd25..92acd25 100644 --- a/test-suite/tests/valid/raw-string.toml +++ b/test-suite/tests/valid/raw-string.milf diff --git a/test-suite/tests/valid/string-delim-end.toml b/test-suite/tests/valid/string-delim-end.milf index 9a41219..9a41219 100644 --- a/test-suite/tests/valid/string-delim-end.toml +++ b/test-suite/tests/valid/string-delim-end.milf diff --git a/test-suite/tests/valid/string-empty.toml b/test-suite/tests/valid/string-empty.milf index e37e681..e37e681 100644 --- a/test-suite/tests/valid/string-empty.toml +++ b/test-suite/tests/valid/string-empty.milf diff --git a/test-suite/tests/valid/string-escapes.toml b/test-suite/tests/valid/string-escapes.milf index 152c6ad..152c6ad 100644 --- a/test-suite/tests/valid/string-escapes.toml +++ b/test-suite/tests/valid/string-escapes.milf diff --git a/test-suite/tests/valid/string-simple.toml b/test-suite/tests/valid/string-simple.milf index e17ade6..e17ade6 100644 --- a/test-suite/tests/valid/string-simple.toml +++ b/test-suite/tests/valid/string-simple.milf diff --git a/test-suite/tests/valid/string-with-pound.toml b/test-suite/tests/valid/string-with-pound.milf index 5fd8746..5fd8746 100644 --- a/test-suite/tests/valid/string-with-pound.toml +++ b/test-suite/tests/valid/string-with-pound.milf diff --git a/test-suite/tests/valid/table-array-implicit.toml b/test-suite/tests/valid/table-array-implicit.milf index 3157ac9..3157ac9 100644 --- a/test-suite/tests/valid/table-array-implicit.toml +++ b/test-suite/tests/valid/table-array-implicit.milf diff --git a/test-suite/tests/valid/table-array-many.toml b/test-suite/tests/valid/table-array-many.milf index 46062be..46062be 100644 --- a/test-suite/tests/valid/table-array-many.toml +++ b/test-suite/tests/valid/table-array-many.milf diff --git a/test-suite/tests/valid/table-array-nest-no-keys.toml b/test-suite/tests/valid/table-array-nest-no-keys.milf index ad6eb10..ad6eb10 100644 --- a/test-suite/tests/valid/table-array-nest-no-keys.toml +++ b/test-suite/tests/valid/table-array-nest-no-keys.milf diff --git a/test-suite/tests/valid/table-array-nest.toml b/test-suite/tests/valid/table-array-nest.milf index d659a3d..d659a3d 100644 --- a/test-suite/tests/valid/table-array-nest.toml +++ b/test-suite/tests/valid/table-array-nest.milf diff --git a/test-suite/tests/valid/table-array-one.toml b/test-suite/tests/valid/table-array-one.milf index cd7e1b6..cd7e1b6 100644 --- a/test-suite/tests/valid/table-array-one.toml +++ b/test-suite/tests/valid/table-array-one.milf diff --git a/test-suite/tests/valid/table-empty.toml b/test-suite/tests/valid/table-empty.milf index 8bb6a0a..8bb6a0a 100644 --- a/test-suite/tests/valid/table-empty.toml +++ b/test-suite/tests/valid/table-empty.milf diff --git a/test-suite/tests/valid/table-multi-empty.toml b/test-suite/tests/valid/table-multi-empty.milf index 2266ed2..2266ed2 100644 --- a/test-suite/tests/valid/table-multi-empty.toml +++ b/test-suite/tests/valid/table-multi-empty.milf diff --git a/test-suite/tests/valid/table-sub-empty.toml b/test-suite/tests/valid/table-sub-empty.milf index 70b7fe1..70b7fe1 100644 --- a/test-suite/tests/valid/table-sub-empty.toml +++ b/test-suite/tests/valid/table-sub-empty.milf diff --git a/test-suite/tests/valid/table-whitespace.toml b/test-suite/tests/valid/table-whitespace.milf index daf881d..daf881d 100644 --- a/test-suite/tests/valid/table-whitespace.toml +++ b/test-suite/tests/valid/table-whitespace.milf diff --git a/test-suite/tests/valid/table-with-pound.toml b/test-suite/tests/valid/table-with-pound.milf index 33f2c4f..33f2c4f 100644 --- a/test-suite/tests/valid/table-with-pound.toml +++ b/test-suite/tests/valid/table-with-pound.milf diff --git a/test-suite/tests/valid/unicode-escape.toml b/test-suite/tests/valid/unicode-escape.milf index 6654252..6654252 100644 --- a/test-suite/tests/valid/unicode-escape.toml +++ b/test-suite/tests/valid/unicode-escape.milf diff --git a/test-suite/tests/valid/unicode-literal.toml b/test-suite/tests/valid/unicode-literal.milf index c65723c..c65723c 100644 --- a/test-suite/tests/valid/unicode-literal.toml +++ b/test-suite/tests/valid/unicode-literal.milf |