@@ -162,7 +162,7 @@ impl Traces {
162
162
///
163
163
/// let layout = Layout::new().title("<b>Line and Scatter Plot</b>".into());
164
164
/// plot.set_layout(layout);
165
- ///
165
+ ///
166
166
/// # if false { // We don't actually want to try and display the plot in a browser when running a doctest.
167
167
/// plot.show();
168
168
/// # }
@@ -645,75 +645,81 @@ mod tests {
645
645
let plot = create_test_plot ( ) ;
646
646
let dst = PathBuf :: from ( "example.html" ) ;
647
647
plot. write_html ( & dst) ;
648
- assert ! ( dst. exists ( ) ) ;
648
+ assert ! ( dst. is_file ( ) ) ;
649
649
assert ! ( std:: fs:: remove_file( & dst) . is_ok( ) ) ;
650
- assert ! ( !dst. exists ( ) ) ;
650
+ assert ! ( !dst. is_file ( ) ) ;
651
651
}
652
652
653
653
#[ test]
654
654
#[ cfg( feature = "kaleido" ) ]
655
+ #[ cfg( not( target_arch = "windows" ) ) ]
655
656
fn test_save_to_png ( ) {
656
657
let plot = create_test_plot ( ) ;
657
658
let dst = PathBuf :: from ( "example.png" ) ;
658
659
plot. write_image ( & dst, ImageFormat :: PNG , 1024 , 680 , 1.0 ) ;
659
- assert ! ( dst. exists ( ) ) ;
660
+ assert ! ( dst. is_file ( ) ) ;
660
661
assert ! ( std:: fs:: remove_file( & dst) . is_ok( ) ) ;
661
- assert ! ( !dst. exists ( ) ) ;
662
+ assert ! ( !dst. is_file ( ) ) ;
662
663
}
663
664
664
665
#[ test]
665
666
#[ cfg( feature = "kaleido" ) ]
667
+ #[ cfg( not( target_arch = "windows" ) ) ]
666
668
fn test_save_to_jpeg ( ) {
667
669
let plot = create_test_plot ( ) ;
668
670
let dst = PathBuf :: from ( "example.jpeg" ) ;
669
671
plot. write_image ( & dst, ImageFormat :: JPEG , 1024 , 680 , 1.0 ) ;
670
- assert ! ( dst. exists ( ) ) ;
672
+ assert ! ( dst. is_file ( ) ) ;
671
673
assert ! ( std:: fs:: remove_file( & dst) . is_ok( ) ) ;
672
- assert ! ( !dst. exists ( ) ) ;
674
+ assert ! ( !dst. is_file ( ) ) ;
673
675
}
674
676
675
677
#[ test]
676
678
#[ cfg( feature = "kaleido" ) ]
679
+ #[ cfg( not( target_arch = "windows" ) ) ]
677
680
fn test_save_to_svg ( ) {
678
681
let plot = create_test_plot ( ) ;
679
682
let dst = PathBuf :: from ( "example.svg" ) ;
680
683
plot. write_image ( & dst, ImageFormat :: SVG , 1024 , 680 , 1.0 ) ;
681
- assert ! ( dst. exists ( ) ) ;
684
+ assert ! ( dst. is_file ( ) ) ;
682
685
assert ! ( std:: fs:: remove_file( & dst) . is_ok( ) ) ;
683
- assert ! ( !dst. exists ( ) ) ;
686
+ assert ! ( !dst. is_file ( ) ) ;
684
687
}
685
688
686
689
#[ test]
687
690
#[ ignore] // This seems to fail unpredictably on MacOs.
691
+ #[ cfg( not( target_arch = "windows" ) ) ]
688
692
#[ cfg( feature = "kaleido" ) ]
689
693
fn test_save_to_eps ( ) {
690
694
let plot = create_test_plot ( ) ;
691
695
let dst = PathBuf :: from ( "example.eps" ) ;
692
696
plot. write_image ( & dst, ImageFormat :: EPS , 1024 , 680 , 1.0 ) ;
693
- assert ! ( dst. exists ( ) ) ;
697
+ assert ! ( dst. is_file ( ) ) ;
694
698
assert ! ( std:: fs:: remove_file( & dst) . is_ok( ) ) ;
695
- assert ! ( !dst. exists ( ) ) ;
699
+ assert ! ( !dst. is_file ( ) ) ;
696
700
}
697
701
698
702
#[ test]
703
+ #[ cfg( not( target_arch = "windows" ) ) ]
699
704
#[ cfg( feature = "kaleido" ) ]
700
705
fn test_save_to_pdf ( ) {
701
706
let plot = create_test_plot ( ) ;
702
707
let dst = PathBuf :: from ( "example.pdf" ) ;
703
708
plot. write_image ( & dst, ImageFormat :: PDF , 1024 , 680 , 1.0 ) ;
704
- assert ! ( dst. exists ( ) ) ;
709
+ assert ! ( dst. is_file ( ) ) ;
705
710
assert ! ( std:: fs:: remove_file( & dst) . is_ok( ) ) ;
706
- assert ! ( !dst. exists ( ) ) ;
711
+ assert ! ( !dst. is_file ( ) ) ;
707
712
}
708
713
709
714
#[ test]
715
+ #[ cfg( not( target_arch = "windows" ) ) ]
710
716
#[ cfg( feature = "kaleido" ) ]
711
717
fn test_save_to_webp ( ) {
712
718
let plot = create_test_plot ( ) ;
713
719
let dst = PathBuf :: from ( "example.webp" ) ;
714
720
plot. write_image ( & dst, ImageFormat :: WEBP , 1024 , 680 , 1.0 ) ;
715
- assert ! ( dst. exists ( ) ) ;
721
+ assert ! ( dst. is_file ( ) ) ;
716
722
assert ! ( std:: fs:: remove_file( & dst) . is_ok( ) ) ;
717
- assert ! ( !dst. exists ( ) ) ;
723
+ assert ! ( !dst. is_file ( ) ) ;
718
724
}
719
725
}
0 commit comments