@@ -126,46 +126,49 @@ extern_fn_clone!(A, B, C, D, E, F)
126
126
extern_fn_clone ! ( A , B , C , D , E , F , G )
127
127
extern_fn_clone ! ( A , B , C , D , E , F , G , H )
128
128
129
- #[ test]
130
- fn test_owned_clone ( ) {
131
- let a = box 5 i;
132
- let b: Box < int > = a. clone ( ) ;
133
- assert_eq ! ( a, b) ;
134
- }
129
+ #[ cfg( test) ]
130
+ mod test {
131
+ #[ test]
132
+ fn test_owned_clone ( ) {
133
+ let a = box 5 i;
134
+ let b: Box < int > = a. clone ( ) ;
135
+ assert_eq ! ( a, b) ;
136
+ }
135
137
136
- #[ test]
137
- fn test_managed_clone ( ) {
138
- let a = @5 i;
139
- let b: @int = a. clone ( ) ;
140
- assert_eq ! ( a, b) ;
141
- }
138
+ #[ test]
139
+ fn test_managed_clone ( ) {
140
+ let a = @5 i;
141
+ let b: @int = a. clone ( ) ;
142
+ assert_eq ! ( a, b) ;
143
+ }
142
144
143
- #[ test]
144
- fn test_borrowed_clone ( ) {
145
- let x = 5 i;
146
- let y: & int = & x;
147
- let z: & int = ( & y) . clone ( ) ;
148
- assert_eq ! ( * z, 5 ) ;
149
- }
145
+ #[ test]
146
+ fn test_borrowed_clone ( ) {
147
+ let x = 5 i;
148
+ let y: & int = & x;
149
+ let z: & int = ( & y) . clone ( ) ;
150
+ assert_eq ! ( * z, 5 ) ;
151
+ }
150
152
151
- #[ test]
152
- fn test_clone_from ( ) {
153
- let a = box 5 ;
154
- let mut b = box 10 ;
155
- b. clone_from ( & a) ;
156
- assert_eq ! ( * b, 5 ) ;
157
- }
153
+ #[ test]
154
+ fn test_clone_from ( ) {
155
+ let a = ~ 5 ;
156
+ let mut b = ~ 10 ;
157
+ b. clone_from ( & a) ;
158
+ assert_eq ! ( * b, 5 ) ;
159
+ }
158
160
159
- #[ test]
160
- fn test_extern_fn_clone ( ) {
161
- trait Empty { }
162
- impl Empty for int { }
161
+ #[ test]
162
+ fn test_extern_fn_clone ( ) {
163
+ trait Empty { }
164
+ impl Empty for int { }
163
165
164
- fn test_fn_a ( ) -> f64 { 1.0 }
165
- fn test_fn_b < T : Empty > ( x : T ) -> T { x }
166
- fn test_fn_c ( _: int , _: f64 , _: ~[ int ] , _: int , _: int , _: int ) { }
166
+ fn test_fn_a ( ) -> f64 { 1.0 }
167
+ fn test_fn_b < T : Empty > ( x : T ) -> T { x }
168
+ fn test_fn_c ( _: int , _: f64 , _: ~[ int ] , _: int , _: int , _: int ) { }
167
169
168
- let _ = test_fn_a. clone ( ) ;
169
- let _ = test_fn_b :: < int > . clone ( ) ;
170
- let _ = test_fn_c. clone ( ) ;
170
+ let _ = test_fn_a. clone ( ) ;
171
+ let _ = test_fn_b :: < int > . clone ( ) ;
172
+ let _ = test_fn_c. clone ( ) ;
173
+ }
171
174
}
0 commit comments