t/regress: indicate todo in command specification
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 4 Dec 2022 22:52:23 +0000 (23:52 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Sun, 4 Dec 2022 22:52:30 +0000 (23:52 +0100)
t/regress.t
t/t2264-minmax_percent.out [moved from t/t2264-minmax_percent_#TODO.out with 64% similarity]

index a10827b1eac937a35dc1ef02d1d10aab1938e93a..06d926e969ca339534592f1fb1e31e14b4f5c7b6 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env perl
 use 5.014;
 use warnings;
-use re '/ms';
+use re '/msx';
 use Getopt::Long qw(2.32 :config gnu_getopt);
 use Test::More;
 use File::Basename;
@@ -23,8 +23,7 @@ plan(tests => int @params);
 for my $candidate (@params) {
        my $name = basename($candidate, '.out');
        $name =~ tr/_/ /;
-       my $todo = $name =~ s/ #TODO$//;
-       local $TODO = $todo ? ' ' : undef;
+       local $TODO;
 
        if (!-e $candidate) {
                local $TODO = 'missing output';
@@ -38,8 +37,11 @@ for my $candidate (@params) {
 
        my $script = $spec;
        chomp $script;
+       $script =~ s/\h* [#]\h* todo \h* (.*?) \z//i
+               and $TODO = $+ || ' ';
        my $wantexit = $script =~ s/\h+[?](\d+)\z// ? $1 : 0;
        my $wantwarn = $script !~ s/[?]\z//;
+
        my $shell = $script;
        if ($script =~ /\|/) {
                # explicit shell wrapper to capture all warnings
similarity index 64%
rename from t/t2264-minmax_percent_#TODO.out
rename to t/t2264-minmax_percent.out
index 7126c7a06514f91178631851f4db7ed9d56513e5..0ad153ce1b6db12a588a30cc96bc69c47915d2f0 100644 (file)
@@ -1,4 +1,4 @@
-barcat --markers=')0v (100v' input/ascii.txt
+barcat --markers=')0v (100v' input/ascii.txt # TODO position before marker character
 123e-6 micro     (---------------------
     .1 long line (---------------------)
     -1           (--------------