@@ -1406,13 +1406,19 @@ foo_module!()
1406
1406
strs_to_idents( vec!( "a" , "c" , "b" , "d" ) ) ) ;
1407
1407
}
1408
1408
1409
+ // test the list of identifier patterns gathered by the visitor. Note that
1410
+ // 'None' is listed as an identifier pattern because we don't yet know that
1411
+ // it's the name of a 0-ary variant, and that 'i' appears twice in succession.
1409
1412
#[ test]
1410
- fn pat_idents_2 ( ) {
1411
- let the_crate = string_to_crate ( "fn main (a : int) -> int {|b| {a + b} }" . to_string ( ) ) ;
1412
- let mut pat_idents = new_name_finder ( Vec :: new ( ) ) ;
1413
- pat_idents. visit_mod ( & the_crate. module , the_crate. span , ast:: CRATE_NODE_ID , ( ) ) ;
1414
- assert_eq ! ( pat_idents. ident_accumulator,
1415
- strs_to_idents( vec!( "a" , "b" ) ) ) ;
1413
+ fn crate_idents ( ) {
1414
+ let the_crate = string_to_crate ( "fn main (a : int) -> int {|b| {
1415
+ match 34 {None => 3, Some(i) | i => j, Foo{k:z,l:y} => \" banana\" }} }" . to_string ( ) ) ;
1416
+ let mut idents = new_name_finder ( Vec :: new ( ) ) ;
1417
+ //visit::walk_crate(&mut idents, &the_crate, ());
1418
+ idents. visit_mod ( & the_crate. module , the_crate. span , ast:: CRATE_NODE_ID , ( ) ) ;
1419
+ assert_eq ! ( idents. ident_accumulator,
1420
+ strs_to_idents( vec!( "a" , "b" , "None" , "i" , "i" , "z" , "y" ) ) ) ;
1416
1421
}
1417
1422
1423
+
1418
1424
}
0 commit comments