File tree 1 file changed +2
-10
lines changed
1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- // xfail-test
12
-
13
11
pub fn main ( ) {
14
- // This is ok
15
12
match & [ ( ~5 , ~7 ) ] {
16
13
ps => {
17
14
let ( ref y, _) = ps[ 0 ] ;
18
- println ! ( "1. y = {}" , * * y) ;
19
15
assert ! ( * * y == 5 ) ;
20
16
}
21
17
}
22
18
23
- // This is not entirely ok
24
19
match Some ( & [ ( ~5 , ) ] ) {
25
20
Some ( ps) => {
26
21
let ( ref y, ) = ps[ 0 ] ;
27
- println ! ( "2. y = {}" , * * y) ;
28
- if * * y != 5 { println ! ( "sadness" ) ; }
22
+ assert ! ( * * y == 5 ) ;
29
23
}
30
24
None => ( )
31
25
}
32
26
33
- // This is not ok
34
27
match Some ( & [ ( ~5 , ~7 ) ] ) {
35
28
Some ( ps) => {
36
29
let ( ref y, ref z) = ps[ 0 ] ;
37
- println ! ( "3. y = {} z = {}" , * * y, * * z) ;
38
30
assert ! ( * * y == 5 ) ;
31
+ assert ! ( * * z == 7 ) ;
39
32
}
40
33
None => ( )
41
34
}
42
35
}
43
-
You can’t perform that action at this time.
0 commit comments