File tree Expand file tree Collapse file tree 1 file changed +18
-13
lines changed
Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -127,17 +127,22 @@ impl PartialEq<i32> for Code {
127127 }
128128}
129129
130- #[ test]
131- fn test_code ( ) {
132- let c: i32 = Code :: new ( 0 ) . into ( ) ;
133- assert_eq ! ( c, 0 ) ;
134- let c = Code :: from ( 0 ) . to_string ( ) ;
135- assert_eq ! ( c, "0x0000" ) ;
136- dbg ! ( Code :: from( 0x200 ) ) ;
137-
138- let c: i8 = Code :: new ( 0 ) . into ( ) ;
139- let mut c: Code = c. into ( ) ;
140-
141- let _: & i32 = & c;
142- let _: & mut i32 = & mut c;
130+ #[ cfg( test) ]
131+ mod tests {
132+ use super :: Code ;
133+
134+ #[ test]
135+ fn test_code ( ) {
136+ let c: i32 = Code :: new ( 0 ) . into ( ) ;
137+ assert_eq ! ( c, 0 ) ;
138+ let c = Code :: from ( 0 ) . to_string ( ) ;
139+ assert_eq ! ( c, "0x0000" ) ;
140+ dbg ! ( Code :: from( 0x200 ) ) ;
141+
142+ let c: i8 = Code :: new ( 0 ) . into ( ) ;
143+ let mut c: Code = c. into ( ) ;
144+
145+ let _: & i32 = & c;
146+ let _: & mut i32 = & mut c;
147+ }
143148}
You can’t perform that action at this time.
0 commit comments