From: Mischa POSLAWSKY Date: Sat, 19 Nov 2022 18:49:59 +0000 (+0100) Subject: t/examples: optional sample/media as exiftool input X-Git-Tag: v1.09~5 X-Git-Url: http://git.shiar.nl/barcat.git/commitdiff_plain/ed5e66a9d56a0aa112a81e10af214150a30eb019 t/examples: optional sample/media as exiftool input --- diff --git a/.gitignore b/.gitignore index 9239659..398e492 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ # review test results /sample/out + +# random cat videos +/sample/media/*.* diff --git a/sample/media/Makefile b/sample/media/Makefile new file mode 100644 index 0000000..c9f7600 --- /dev/null +++ b/sample/media/Makefile @@ -0,0 +1,23 @@ +DL = curl -sSf -o $@ +YTDL = yt-dlp -o $@ +DLV = $(YTDL) -S codec,+size +DLA = $(YTDL) -x --audio-format opus + +media: utrecht-pub.jpg nyan.gif taddy-skates.webm serbia-bike.webm alugalug-intl.webm + +utrecht-pub.jpg: + # https://www.flickr.com/photos/albatz/25540736521 + $(DL) https://live.staticflickr.com/1502/25540736521_b42ff96bc8_c.jpg + +nyan.gif: + # https://prguitarman.tumblr.com/post/4281177195 + $(DL) https://64.media.tumblr.com/tumblr_lj0wls8poh1qb9bjho1_400.gifv + +taddy-skates.webm: + $(DLV) https://www.youtube.com/watch?v=YiE8V7sqjvw + +serbia-bike.webm: + $(DLV) https://www.youtube.com/watch?v=uAV2XE1d2Bo # 1bike1world + +alugalug-intl.opus: + $(DLA) https://www.youtube.com/watch?v=S61ENc51Z1Q # The Kiffness diff --git a/t/examples.t b/t/examples.t index cfe0e3f..0f313ec 100755 --- a/t/examples.t +++ b/t/examples.t @@ -11,8 +11,10 @@ use Test::More; } my %CMDARGS = ( - ping => '-c 1', + ping => '-c 1 ', 'cat \Khttpd/' => '/var/log/apache2/', + ' \K\*(?=\h*\|)' => 'sample/media/*.*', + find => 'sample/media -name \*.\* ', ); my $filename = 'barcat'; @@ -68,8 +70,8 @@ SKIP: { # prepare shell command to execute while (my ($subcmd, $args) = each %CMDARGS) { - $subcmd .= " \\K", $args .= ' ' unless $subcmd =~ m/\\K/; - $cmd =~ s/\b$subcmd/$args/; + $subcmd .= " \\K" unless $subcmd =~ m/\\K/; + $cmd =~ s/$subcmd/$args/; } for my $param ($cmd =~ m{^[(\h]* (\w\S*)}gx) {