Remove commented code in test_macros.rs

This commit is contained in:
David Tolnay 2016-07-17 21:09:44 -07:00
parent fa51083a12
commit 334a6e788a
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -39,23 +39,19 @@ struct DeNamedMap<A, B, C> {
} }
#[derive(Debug, PartialEq, Serialize)] #[derive(Debug, PartialEq, Serialize)]
enum SerEnum<'a, B: 'a, C: /* Trait + */ 'a, D> where D: /* Trait + */ 'a { enum SerEnum<'a, B: 'a, C: 'a, D> where D: 'a {
Unit, Unit,
Seq( Seq(
i8, i8,
B, B,
&'a C, &'a C,
//C::Type,
&'a mut D, &'a mut D,
//<D as Trait>::Type,
), ),
Map { Map {
a: i8, a: i8,
b: B, b: B,
c: &'a C, c: &'a C,
//d: C::Type, d: &'a mut D,
e: &'a mut D,
//f: <D as Trait>::Type,
}, },
// Make sure we can support more than one variant. // Make sure we can support more than one variant.
@ -64,38 +60,30 @@ enum SerEnum<'a, B: 'a, C: /* Trait + */ 'a, D> where D: /* Trait + */ 'a {
i8, i8,
B, B,
&'a C, &'a C,
//C::Type,
&'a mut D, &'a mut D,
//<D as Trait>::Type,
), ),
_Map2 { _Map2 {
a: i8, a: i8,
b: B, b: B,
c: &'a C, c: &'a C,
//d: C::Type, d: &'a mut D,
e: &'a mut D,
//f: <D as Trait>::Type,
}, },
} }
#[derive(Debug, PartialEq, Serialize, Deserialize)] #[derive(Debug, PartialEq, Serialize, Deserialize)]
enum DeEnum<B, C: /* Trait */, D> /* where D: Trait */ { enum DeEnum<B, C, D> {
Unit, Unit,
Seq( Seq(
i8, i8,
B, B,
C, C,
//C::Type,
D, D,
//<D as Trait>::Type,
), ),
Map { Map {
a: i8, a: i8,
b: B, b: B,
c: C, c: C,
//d: C::Type, d: D,
e: D,
//f: <D as Trait>::Type,
}, },
// Make sure we can support more than one variant. // Make sure we can support more than one variant.
@ -104,17 +92,13 @@ enum DeEnum<B, C: /* Trait */, D> /* where D: Trait */ {
i8, i8,
B, B,
C, C,
//C::Type,
D, D,
//<D as Trait>::Type,
), ),
_Map2 { _Map2 {
a: i8, a: i8,
b: B, b: B,
c: C, c: C,
//d: C::Type, d: D,
e: D,
//f: <D as Trait>::Type,
}, },
} }
@ -301,18 +285,14 @@ fn test_ser_enum_seq() {
let a = 1; let a = 1;
let b = 2; let b = 2;
let c = 3; let c = 3;
//let d = 4; let mut d = 4;
let mut e = 5;
//let f = 6;
assert_ser_tokens( assert_ser_tokens(
&SerEnum::Seq( &SerEnum::Seq(
a, a,
b, b,
&c, &c,
//d, &mut d,
&mut e,
//f,
), ),
&[ &[
Token::EnumSeqStart("SerEnum", "Seq", 4), Token::EnumSeqStart("SerEnum", "Seq", 4),
@ -327,7 +307,7 @@ fn test_ser_enum_seq() {
Token::I32(3), Token::I32(3),
Token::EnumSeqSep, Token::EnumSeqSep,
Token::I32(5), Token::I32(4),
Token::EnumSeqEnd, Token::EnumSeqEnd,
], ],
@ -339,18 +319,14 @@ fn test_ser_enum_map() {
let a = 1; let a = 1;
let b = 2; let b = 2;
let c = 3; let c = 3;
//let d = 4; let mut d = 4;
let mut e = 5;
//let f = 6;
assert_ser_tokens( assert_ser_tokens(
&SerEnum::Map { &SerEnum::Map {
a: a, a: a,
b: b, b: b,
c: &c, c: &c,
//d: d, d: &mut d,
e: &mut e,
//f: f,
}, },
&[ &[
Token::EnumMapStart("SerEnum", "Map", 4), Token::EnumMapStart("SerEnum", "Map", 4),
@ -368,8 +344,8 @@ fn test_ser_enum_map() {
Token::I32(3), Token::I32(3),
Token::EnumMapSep, Token::EnumMapSep,
Token::Str("e"), Token::Str("d"),
Token::I32(5), Token::I32(4),
Token::EnumMapEnd, Token::EnumMapEnd,
], ],
@ -391,18 +367,14 @@ fn test_de_enum_seq() {
let a = 1; let a = 1;
let b = 2; let b = 2;
let c = 3; let c = 3;
//let d = 4; let d = 4;
let e = 5;
//let f = 6;
assert_tokens( assert_tokens(
&DeEnum::Seq( &DeEnum::Seq(
a, a,
b, b,
c, c,
//d, d,
e,
//f,
), ),
&[ &[
Token::EnumSeqStart("DeEnum", "Seq", 4), Token::EnumSeqStart("DeEnum", "Seq", 4),
@ -417,7 +389,7 @@ fn test_de_enum_seq() {
Token::I32(3), Token::I32(3),
Token::EnumSeqSep, Token::EnumSeqSep,
Token::I32(5), Token::I32(4),
Token::EnumSeqEnd, Token::EnumSeqEnd,
], ],
@ -429,18 +401,14 @@ fn test_de_enum_map() {
let a = 1; let a = 1;
let b = 2; let b = 2;
let c = 3; let c = 3;
//let d = 4; let d = 4;
let e = 5;
//let f = 6;
assert_tokens( assert_tokens(
&DeEnum::Map { &DeEnum::Map {
a: a, a: a,
b: b, b: b,
c: c, c: c,
//d: d, d: d,
e: e,
//f: f,
}, },
&[ &[
Token::EnumMapStart("DeEnum", "Map", 4), Token::EnumMapStart("DeEnum", "Map", 4),
@ -458,8 +426,8 @@ fn test_de_enum_map() {
Token::I32(3), Token::I32(3),
Token::EnumMapSep, Token::EnumMapSep,
Token::Str("e"), Token::Str("d"),
Token::I32(5), Token::I32(4),
Token::EnumMapEnd, Token::EnumMapEnd,
], ],