File tree Expand file tree Collapse file tree 1 file changed +38
-2
lines changed Expand file tree Collapse file tree 1 file changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use derive_where::derive_where;
33use crate :: util:: { AssertDebug , Wrapper } ;
44
55#[ test]
6- fn all ( ) {
6+ fn struct_all ( ) {
77 #[ derive_where( Debug ) ]
88 #[ derive_where( skip_inner) ]
99 struct Test < T > {
@@ -18,7 +18,7 @@ fn all() {
1818}
1919
2020#[ test]
21- fn partial ( ) {
21+ fn struct_partial ( ) {
2222 #[ derive_where( Debug ) ]
2323 struct Test < T > {
2424 #[ derive_where( skip) ]
@@ -35,3 +35,39 @@ fn partial() {
3535
3636 assert_eq ! ( format!( "{:?}" , test_1) , "Test { b: 42, .. }" ) ;
3737}
38+
39+ #[ test]
40+ fn variant_all ( ) {
41+ #[ derive_where( Debug ) ]
42+ enum Test < T > {
43+ #[ derive_where( skip_inner) ]
44+ A { a : Wrapper < T > } ,
45+ }
46+
47+ let test_1 = Test :: A { a : 42 . into ( ) } ;
48+
49+ let _ = AssertDebug ( & test_1) ;
50+
51+ assert_eq ! ( format!( "{:?}" , test_1) , "A { .. }" ) ;
52+ }
53+
54+ #[ test]
55+ fn variant_partial ( ) {
56+ #[ derive_where( Debug ) ]
57+ enum Test < T > {
58+ A {
59+ #[ derive_where( skip) ]
60+ a : Wrapper < T > ,
61+ b : Wrapper < T > ,
62+ } ,
63+ }
64+
65+ let test_1 = Test :: A {
66+ a : 42 . into ( ) ,
67+ b : 42 . into ( ) ,
68+ } ;
69+
70+ let _ = AssertDebug ( & test_1) ;
71+
72+ assert_eq ! ( format!( "{:?}" , test_1) , "A { b: 42, .. }" ) ;
73+ }
You can’t perform that action at this time.
0 commit comments