@@ -245,8 +245,8 @@ impl FixtureMeta {
245
245
/// line 2
246
246
/// // - other meta
247
247
/// ```
248
- pub fn parse_fixture ( fixture : & str ) -> Vec < FixtureEntry > {
249
- let fixture = indent_first_line ( fixture ) ;
248
+ pub fn parse_fixture ( ra_fixture : & str ) -> Vec < FixtureEntry > {
249
+ let fixture = indent_first_line ( ra_fixture ) ;
250
250
let margin = fixture_margin ( & fixture) ;
251
251
252
252
let mut lines = fixture
@@ -418,14 +418,16 @@ struct Bar;
418
418
419
419
#[ test]
420
420
fn parse_fixture_gets_full_meta ( ) {
421
- let fixture = r"
421
+ let parsed = parse_fixture (
422
+ r"
422
423
//- /lib.rs crate:foo deps:bar,baz cfg:foo=a,bar=b,atom env:OUTDIR=path/to,OTHER=foo
423
- " ;
424
- let parsed = parse_fixture ( fixture) ;
424
+ mod m;
425
+ " ,
426
+ ) ;
425
427
assert_eq ! ( 1 , parsed. len( ) ) ;
426
428
427
429
let parsed = & parsed[ 0 ] ;
428
- assert_eq ! ( "\n " , parsed. text) ;
430
+ assert_eq ! ( "mod m; \n \n " , parsed. text) ;
429
431
430
432
let meta = & parsed. meta ;
431
433
assert_eq ! ( "foo" , meta. crate_name( ) . unwrap( ) ) ;
@@ -435,12 +437,12 @@ fn parse_fixture_gets_full_meta() {
435
437
}
436
438
437
439
/// Same as `parse_fixture`, except it allow empty fixture
438
- pub fn parse_single_fixture ( fixture : & str ) -> Option < FixtureEntry > {
439
- if !fixture . lines ( ) . any ( |it| it. trim_start ( ) . starts_with ( "//-" ) ) {
440
+ pub fn parse_single_fixture ( ra_fixture : & str ) -> Option < FixtureEntry > {
441
+ if !ra_fixture . lines ( ) . any ( |it| it. trim_start ( ) . starts_with ( "//-" ) ) {
440
442
return None ;
441
443
}
442
444
443
- let fixtures = parse_fixture ( fixture ) ;
445
+ let fixtures = parse_fixture ( ra_fixture ) ;
444
446
if fixtures. len ( ) > 1 {
445
447
panic ! ( "too many fixtures" ) ;
446
448
}
0 commit comments