From b9d9d4ff925106e3cf11a15181808aa8f308b236 Mon Sep 17 00:00:00 2001 From: topecongiro Date: Mon, 5 Jun 2017 22:57:01 +0900 Subject: [PATCH] Update tests Closes #984, closes #1261, closes #1462 --- tests/source/attrib.rs | 10 ++++++++++ tests/source/enum.rs | 11 +++++++++++ tests/source/struct-field-attributes.rs | 15 +++++++++++++++ tests/target/attrib.rs | 10 ++++++++++ tests/target/enum.rs | 9 +++++++++ tests/target/nestedmod/mod.rs | 2 +- tests/target/nestedmod/mod2b.rs | 2 +- tests/target/struct-field-attributes.rs | 15 +++++++++++++++ 8 files changed, 72 insertions(+), 2 deletions(-) diff --git a/tests/source/attrib.rs b/tests/source/attrib.rs index a47c2507156..593fb0ff57e 100644 --- a/tests/source/attrib.rs +++ b/tests/source/attrib.rs @@ -41,4 +41,14 @@ impl Bar { /// Blah blah bing. fn f4(self) -> Cat { } + + // We want spaces around `=` + #[cfg(feature="nightly")] + fn f5(self) -> Monkey {} +} + +// #984 +struct Foo { + # [ derive ( Clone , PartialEq , Debug , Deserialize , Serialize ) ] + foo: usize, } diff --git a/tests/source/enum.rs b/tests/source/enum.rs index 0e2e2c066c3..6992ca53c1b 100644 --- a/tests/source/enum.rs +++ b/tests/source/enum.rs @@ -109,3 +109,14 @@ pub enum Bencoding<'i> { // TODO make Dict "structlike" AKA name the two values. Dict(&'i [u8], BTreeMap<&'i [u8], Bencoding<'i>>), } + +// #1261 +pub enum CoreResourceMsg { + SetCookieForUrl( + ServoUrl, + #[serde(deserialize_with = "::hyper_serde::deserialize", + serialize_with = "::hyper_serde::serialize")] + Cookie, + CookieSource + ), +} diff --git a/tests/source/struct-field-attributes.rs b/tests/source/struct-field-attributes.rs index 2e5381a7e41..6fc69c2dfe4 100644 --- a/tests/source/struct-field-attributes.rs +++ b/tests/source/struct-field-attributes.rs @@ -20,3 +20,18 @@ fn do_something() -> Foo { fn main() { do_something(); } + +// #1462 +struct Foo { + foo: usize, + #[cfg(feature="include-bar")] + bar: usize, +} + +fn new_foo() -> Foo { + Foo { + foo: 0, + #[cfg(feature="include-bar")] + bar: 0, + } +} diff --git a/tests/target/attrib.rs b/tests/target/attrib.rs index b861b971d9b..fb70585bd21 100644 --- a/tests/target/attrib.rs +++ b/tests/target/attrib.rs @@ -37,4 +37,14 @@ impl Bar { // tooooooooooooooooooooooooooooooo loooooooooooong. /// Blah blah bing. fn f4(self) -> Cat {} + + // We want spaces around `=` + #[cfg(feature = "nightly")] + fn f5(self) -> Monkey {} +} + +// #984 +struct Foo { + #[derive(Clone, PartialEq, Debug, Deserialize, Serialize)] + foo: usize, } diff --git a/tests/target/enum.rs b/tests/target/enum.rs index 3e0e46d3fae..0bb18e2df67 100644 --- a/tests/target/enum.rs +++ b/tests/target/enum.rs @@ -139,3 +139,12 @@ pub enum Bencoding<'i> { // TODO make Dict "structlike" AKA name the two values. Dict(&'i [u8], BTreeMap<&'i [u8], Bencoding<'i>>), } + +// #1261 +pub enum CoreResourceMsg { + SetCookieForUrl(ServoUrl, + #[serde(deserialize_with = "::hyper_serde::deserialize", + serialize_with = "::hyper_serde::serialize")] + Cookie, + CookieSource), +} diff --git a/tests/target/nestedmod/mod.rs b/tests/target/nestedmod/mod.rs index b3456bf0d0f..ff0d55b0175 100644 --- a/tests/target/nestedmod/mod.rs +++ b/tests/target/nestedmod/mod.rs @@ -7,7 +7,7 @@ mod mymod1 { mod mod3a; } -#[path="mod2c.rs"] +#[path = "mod2c.rs"] mod mymod2; mod submod2; diff --git a/tests/target/nestedmod/mod2b.rs b/tests/target/nestedmod/mod2b.rs index f128e2da6db..f06766f304f 100644 --- a/tests/target/nestedmod/mod2b.rs +++ b/tests/target/nestedmod/mod2b.rs @@ -1,3 +1,3 @@ -#[path="mod2a.rs"] +#[path = "mod2a.rs"] mod c; diff --git a/tests/target/struct-field-attributes.rs b/tests/target/struct-field-attributes.rs index 2e5381a7e41..8ae40ac9bdf 100644 --- a/tests/target/struct-field-attributes.rs +++ b/tests/target/struct-field-attributes.rs @@ -20,3 +20,18 @@ fn do_something() -> Foo { fn main() { do_something(); } + +// #1462 +struct Foo { + foo: usize, + #[cfg(feature = "include-bar")] + bar: usize, +} + +fn new_foo() -> Foo { + Foo { + foo: 0, + #[cfg(feature = "include-bar")] + bar: 0, + } +}