@@ -2,7 +2,7 @@ use stackable_versioned_macros::versioned;
2
2
3
3
#[ ignore]
4
4
#[ test]
5
- fn pass_container_attributes ( ) {
5
+ fn pass_struct_attributes ( ) {
6
6
/// General struct docs that cover all versions.
7
7
#[ versioned(
8
8
version( name = "v1alpha1" ) ,
@@ -60,3 +60,47 @@ fn pass_container_attributes() {
60
60
quux : String :: from ( "World" ) ,
61
61
} ;
62
62
}
63
+
64
+ #[ ignore]
65
+ #[ allow( dead_code) ]
66
+ #[ test]
67
+ fn pass_enum_attributes ( ) {
68
+ /// General enum docs that cover all versions.
69
+ #[ versioned(
70
+ version( name = "v1alpha1" ) ,
71
+ version(
72
+ name = "v1beta1" ,
73
+ doc = r#"
74
+ Additional docs for this version which are purposefully long to
75
+ show how manual line wrapping works. \
76
+ Multi-line docs are also supported, as per regular doc-comments.
77
+ "#
78
+ ) ,
79
+ version( name = "v1beta2" ) ,
80
+ version( name = "v1" ) ,
81
+ version( name = "v2" ) ,
82
+ options( skip( from) )
83
+ ) ]
84
+ #[ derive( Default ) ]
85
+ enum Foo {
86
+ /// This variant is available in every version (so far).
87
+ #[ default]
88
+ Foo ,
89
+
90
+ /// Keep the main field docs the same, even after the field is
91
+ /// deprecated.
92
+ #[ versioned( deprecated( since = "v1beta1" , note = "gone" ) ) ]
93
+ DeprecatedBar ,
94
+
95
+ /// This is for baz
96
+ #[ versioned( added( since = "v1beta1" ) ) ]
97
+ // Just to check stackable-versioned deprecation warning appears.
98
+ // #[deprecated]
99
+ Baz ,
100
+
101
+ /// This is will keep changing over time.
102
+ #[ versioned( renamed( since = "v1beta1" , from = "Qoox" ) ) ]
103
+ #[ versioned( renamed( since = "v1" , from = "Qaax" ) ) ]
104
+ Quux ,
105
+ }
106
+ }
0 commit comments