This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Don’t LEAVE_with_name("evalcomp") for syntax errors
[perl5.git] / t / op / threads-dirh.t
index 2e05f5d..b481992 100644 (file)
@@ -9,14 +9,8 @@ BEGIN {
      $| = 1;
 
      require Config;
-     if (!$Config::Config{useithreads}) {
-        print "1..0 # Skip: no ithreads\n";
-        exit 0;
-     }
-     if ($ENV{PERL_CORE_MINITEST}) {
-       print "1..0 # Skip: no dynamic loading on miniperl, no threads\n";
-       exit 0;
-     }
+     skip_all_without_config('useithreads');
+     skip_all_if_miniperl("no dynamic loading on miniperl, no threads");
 
      plan(6);
 }
@@ -45,8 +39,8 @@ SKIP: {
    skip $_[0], 5
  };
 
- if(!$Config::Config{d_fchdir}) {
-  $::TODO = 'dir handle cloning currently requires fchdir';
+ if(!$Config::Config{d_fchdir} && $^O ne "MSWin32") {
+  $::TODO = 'dir handle cloning currently requires fchdir on non-Windows platforms';
  }
 
  my @w :shared; # warnings accumulator
@@ -92,10 +86,13 @@ SKIP: {
 
  seekdir $toberead, $start_pos;
  readdir $toberead for 1 .. @first_2+@from_thread;
- is
-   async { readdir $toberead // 'undef' } ->join, 'undef',
-  'cloned dir iterator that points to the end of the directory'
- ;
+ {
+  local $::TODO; # This always passes when dir handles are not cloned.
+  is
+    async { readdir $toberead // 'undef' } ->join, 'undef',
+   'cloned dir iterator that points to the end of the directory'
+  ;
+ }
 
  # Make sure the cloning code can handle file names longer than 255 chars
  SKIP: {
@@ -105,7 +102,7 @@ SKIP: {
    . "pneumonoultramicroscopicsilicovolcanoconiosis-"
    . "lopadotemachoselachogaleokranioleipsanodrimypotrimmatosilphiokarabo"
    . "melitokatakechymenokichlepikossyphophattoperisteralektryonoptokephal"
-   . "liokinklopeleiolagoiosiraibaphetraganopterygon"
+   . "liokinklopeleiolagoiosiraiobaphetraganopterygon"
     or
      chdir updir,
      skip("OS does not support long file names (and I mean *long*)", 1);
@@ -122,7 +119,7 @@ SKIP: {
     last;
    }
   }
-  is length async { scalar readdir $dirh } ->join, 257, $test_name;
+  is length async { scalar readdir $dirh } ->join, 258, $test_name;
  }
 
  is scalar @w, 0, 'no warnings during all that' or diag @w;