From 96e83823c4b9ba26b6b65a7f5563d93fa21571ff Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 4 Dec 2022 23:52:23 +0100 Subject: [PATCH] t/regress: indicate todo in command specification --- t/regress.t | 8 +++++--- ...-minmax_percent_#TODO.out => t2264-minmax_percent.out} | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) rename t/{t2264-minmax_percent_#TODO.out => t2264-minmax_percent.out} (64%) diff --git a/t/regress.t b/t/regress.t index a10827b..06d926e 100755 --- a/t/regress.t +++ b/t/regress.t @@ -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 diff --git a/t/t2264-minmax_percent_#TODO.out b/t/t2264-minmax_percent.out similarity index 64% rename from t/t2264-minmax_percent_#TODO.out rename to t/t2264-minmax_percent.out index 7126c7a..0ad153c 100644 --- a/t/t2264-minmax_percent_#TODO.out +++ b/t/t2264-minmax_percent.out @@ -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 (-------------- -- 2.30.0