@@ -417,20 +417,23 @@ mod test {
417
417
418
418
use super :: { FileInput , make_path_option_vec, input_vec, input_vec_state} ;
419
419
420
- use std:: io;
420
+ use std:: rt:: io;
421
+ use std:: rt:: io:: Writer ;
422
+ use std:: rt:: io:: file;
421
423
use std:: uint;
422
424
use std:: vec;
423
425
424
426
fn make_file ( path : & Path , contents : & [ ~str ] ) {
425
- let file = io :: file_writer ( path, [ io:: Create , io:: Truncate ] ) . unwrap ( ) ;
427
+ let mut file = file :: open ( path, io:: CreateOrTruncate , io:: Write ) . unwrap ( ) ;
426
428
427
429
for str in contents. iter ( ) {
428
- file. write_str ( * str) ;
429
- file. write_char ( '\n' ) ;
430
+ file. write ( str. as_bytes ( ) ) ;
431
+ file. write ( [ '\n' as u8 ] ) ;
430
432
}
431
433
}
432
434
433
435
#[ test]
436
+ #[ ignore( cfg( windows) ) ] // FIXME(#8810): rt::io::file and windows don't agree
434
437
fn test_make_path_option_vec ( ) {
435
438
let strs = [ ~"some/path",
436
439
~"some/other/path"] ;
@@ -445,6 +448,7 @@ mod test {
445
448
}
446
449
447
450
#[test]
451
+ #[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
448
452
fn test_fileinput_read_byte() {
449
453
let filenames = make_path_option_vec(vec::from_fn(
450
454
3,
@@ -475,6 +479,7 @@ mod test {
475
479
}
476
480
477
481
#[test]
482
+ #[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
478
483
fn test_fileinput_read() {
479
484
let filenames = make_path_option_vec(vec::from_fn(
480
485
3,
@@ -495,6 +500,7 @@ mod test {
495
500
}
496
501
497
502
#[ test]
503
+ #[ ignore( cfg( windows) ) ] // FIXME(#8810): rt::io::file and windows don't agree
498
504
fn test_input_vec( ) {
499
505
let mut all_lines = ~[ ] ;
500
506
let filenames = make_path_option_vec( vec:: from_fn(
@@ -518,6 +524,7 @@ mod test {
518
524
}
519
525
520
526
#[ test]
527
+ #[ ignore( cfg( windows) ) ] // FIXME(#8810): rt::io::file and windows don't agree
521
528
fn test_input_vec_state( ) {
522
529
let filenames = make_path_option_vec( vec:: from_fn(
523
530
3 ,
@@ -540,6 +547,7 @@ mod test {
540
547
}
541
548
542
549
#[ test]
550
+ #[ ignore( cfg( windows) ) ] // FIXME(#8810): rt::io::file and windows don't agree
543
551
fn test_empty_files( ) {
544
552
let filenames = make_path_option_vec( vec:: from_fn(
545
553
3 ,
@@ -564,18 +572,21 @@ mod test {
564
572
}
565
573
566
574
#[test]
575
+ #[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
567
576
fn test_no_trailing_newline() {
568
577
let f1 =
569
578
Some(Path(" tmp/lib-fileinput-test-no-trailing-newline-1 . tmp"));
570
579
let f2 =
571
580
Some(Path(" tmp/lib-fileinput-test-no-trailing-newline-2 . tmp"));
572
581
573
- let wr = io::file_writer(f1.get_ref(),
574
- [io::Create, io::Truncate]).unwrap();
575
- wr.write_str(" 1 \n 2 ");
576
- let wr = io::file_writer(f2.get_ref(),
577
- [io::Create, io::Truncate]).unwrap();
578
- wr.write_str(" 3 \n 4 ");
582
+ {
583
+ let mut wr = file::open(f1.get_ref(), io::CreateOrTruncate,
584
+ io::Write).unwrap();
585
+ wr.write(" 1 \n 2 ".as_bytes());
586
+ let mut wr = file::open(f2.get_ref(), io::CreateOrTruncate,
587
+ io::Write).unwrap();
588
+ wr.write(" 3 \n 4 ".as_bytes());
589
+ }
579
590
580
591
let mut lines = ~[];
581
592
do input_vec(~[f1, f2]) |line| {
@@ -587,6 +598,7 @@ mod test {
587
598
588
599
589
600
#[test]
601
+ #[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
590
602
fn test_next_file() {
591
603
let filenames = make_path_option_vec(vec::from_fn(
592
604
3,
@@ -618,6 +630,7 @@ mod test {
618
630
619
631
#[test]
620
632
#[should_fail]
633
+ #[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
621
634
fn test_input_vec_missing_file() {
622
635
do input_vec(make_path_option_vec([~" this/file/doesnt/exist" ] , true ) ) |line| {
623
636
println( line) ;
0 commit comments