develooper Front page | perl.perl5.porters | Postings from February 2018

minitest t/op/state.t

Thread Next
From:
hv
Date:
February 3, 2018 11:17
Subject:
minitest t/op/state.t
Message ID:
201802031041.w13AfUP12910@crypt.org
There's a couple of test files failing under minitest; I've fixed
t/io/open.t, and am looking at t/op/state.t which is failing for me
with "Can't locate attributes.pm in @INC" for the uses of C<:shared>
in the forbidden checks.

I can add this as another pattern in the like(), but I think it would
be more accurate to skip. I'm assuming that "we're running under miniperl"
is the only reason we should see anything other than:
  Initialization of state variables in list currently forbidden
so I'm planning to push the patch below, am I missing anything?

Hugo

diff --git a/t/op/state.t b/t/op/state.t
index 67439be..7aef435 100644
--- a/t/op/state.t
+++ b/t/op/state.t
@@ -391,14 +391,17 @@ foreach my $spam (@spam) {
 
 
 foreach my $forbidden (<DATA>) {
-    chomp $forbidden;
-    no strict 'vars';
-    eval $forbidden;
-    like $@,
-         qr/dynamic loading not available(?x:
-          )|Attempt to reload attributes\.pm aborted(?x:
-          )|Initialization of state variables in list currently forbidden/,
-        "Currently forbidden: $forbidden";
+    SKIP: {
+        skip_if_miniperl("miniperl can't load attributes.pm", 1)
+                if $forbidden =~ /:shared/;
+
+        chomp $forbidden;
+        no strict 'vars';
+        eval $forbidden;
+        like $@,
+            qr/Initialization of state variables in list currently forbidden/,
+            "Currently forbidden: $forbidden";
+    }
 }
 
 # [perl #49522] state variable not available

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About