Skip to content

Commit 451646c

Browse files
committed
improve variant tests
1 parent 0c0afe8 commit 451646c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/tests.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ fn ser_de_variant_unit() {
311311
A,
312312
B,
313313
};
314-
test_ser_de_eq(Mock::A);
315-
test_ser_de_eq(Mock::B);
314+
test_ser_de_eq(("pre".to_string(), Mock::A, "post".to_string()));
315+
test_ser_de_eq(("pre".to_string(), Mock::B, "post".to_string()));
316316
}
317317

318318
#[test]
@@ -322,8 +322,8 @@ fn ser_de_variant_newtype() {
322322
A(i64),
323323
B(i64),
324324
};
325-
test_ser_de_eq(Mock::A(123));
326-
test_ser_de_eq(Mock::B(321));
325+
test_ser_de_eq(("pre".to_string(), Mock::A(123), "post".to_string()));
326+
test_ser_de_eq(("pre".to_string(), Mock::B(321), "post".to_string()));
327327
}
328328

329329
#[test]
@@ -333,8 +333,8 @@ fn ser_de_variant_tuple() {
333333
A(i64, i64),
334334
B(i64, i64),
335335
};
336-
test_ser_de_eq(Mock::A(123, 321));
337-
test_ser_de_eq(Mock::B(321, 123));
336+
test_ser_de_eq(("pre".to_string(), Mock::A(123, 321), "post".to_string()));
337+
test_ser_de_eq(("pre".to_string(), Mock::B(321, 123), "post".to_string()));
338338
}
339339

340340
#[test]
@@ -344,8 +344,8 @@ fn ser_de_variant_struct() {
344344
A { a: i64, b: i64 },
345345
B { c: i64, d: i64 },
346346
};
347-
test_ser_de_eq(Mock::A { a: 123, b: 321 });
348-
test_ser_de_eq(Mock::B { c: 321, d: 123 });
347+
test_ser_de_eq(("pre".to_string(), Mock::A { a: 123, b: 321 }, "post".to_string()));
348+
test_ser_de_eq(("pre".to_string(), Mock::B { c: 321, d: 123 }, "post".to_string()));
349349
}
350350

351351
#[test]

0 commit comments

Comments
 (0)