Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
topecongiro committed Jun 5, 2017
1 parent 92b56d3 commit b9d9d4f
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 2 deletions.
10 changes: 10 additions & 0 deletions tests/source/attrib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
11 changes: 11 additions & 0 deletions tests/source/enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
}
15 changes: 15 additions & 0 deletions tests/source/struct-field-attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
10 changes: 10 additions & 0 deletions tests/target/attrib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
9 changes: 9 additions & 0 deletions tests/target/enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
2 changes: 1 addition & 1 deletion tests/target/nestedmod/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mod mymod1 {
mod mod3a;
}

#[path="mod2c.rs"]
#[path = "mod2c.rs"]
mod mymod2;

mod submod2;
2 changes: 1 addition & 1 deletion tests/target/nestedmod/mod2b.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

#[path="mod2a.rs"]
#[path = "mod2a.rs"]
mod c;
15 changes: 15 additions & 0 deletions tests/target/struct-field-attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

0 comments on commit b9d9d4f

Please sign in to comment.