diff options
author | David Tolnay <dtolnay@gmail.com> | 2017-11-12 17:26:09 -0800 |
---|---|---|
committer | David Tolnay <dtolnay@gmail.com> | 2017-11-12 19:33:11 -0800 |
commit | 3ad6e71f53a87215fb5286bcf87de15524699561 (patch) | |
tree | f9ac5154af7984a7c65b903869487c11baee3596 /tests/display-tricky.rs | |
parent | 3b77b5fb6520c7bf13be6308978efa8a185d0c12 (diff) | |
download | milf-rs-3ad6e71f53a87215fb5286bcf87de15524699561.tar.gz milf-rs-3ad6e71f53a87215fb5286bcf87de15524699561.zip |
Move tests into their own crate
Diffstat (limited to 'tests/display-tricky.rs')
-rw-r--r-- | tests/display-tricky.rs | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/tests/display-tricky.rs b/tests/display-tricky.rs deleted file mode 100644 index 069e0f9..0000000 --- a/tests/display-tricky.rs +++ /dev/null @@ -1,49 +0,0 @@ -extern crate toml; -#[macro_use] extern crate serde_derive; - -#[derive(Debug, Serialize, Deserialize)] -pub struct Recipe { - pub name: String, - pub description: Option<String>, - #[serde(default)] - pub modules: Vec<Modules>, - #[serde(default)] - pub packages: Vec<Packages> -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct Modules { - pub name: String, - pub version: Option<String> -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct Packages { - pub name: String, - pub version: Option<String> -} - -#[test] -fn both_ends() { - let recipe_works = toml::from_str::<Recipe>(r#" - name = "testing" - description = "example" - modules = [] - - [[packages]] - name = "base" - "#).unwrap(); - toml::to_string(&recipe_works).unwrap(); - - let recipe_fails = toml::from_str::<Recipe>(r#" - name = "testing" - description = "example" - packages = [] - - [[modules]] - name = "base" - "#).unwrap(); - - let recipe_toml = toml::Value::try_from(recipe_fails).unwrap(); - recipe_toml.to_string(); -} |