git.shiar.nl
/
barcat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
40fc64b
)
script to run examples from documentation
author
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 13 Mar 2021 03:54:50 +0000
(
04:54
+0100)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 18 Apr 2022 09:04:29 +0000
(11:04 +0200)
t/examples.t
[new file with mode: 0755]
patch
|
blob
diff --git a/t/examples.t
b/t/examples.t
new file mode 100755
(executable)
index 0000000..
19c1377
--- /dev/null
+++ b/
t/examples.t
@@ -0,0
+1,20
@@
+#!/usr/bin/env perl
+use 5.014;
+use warnings;
+use Test::More;
+
+my $filename = 'barcat';
+open my $input, '<', $filename
+ or die "Cannot read documentation from $filename script\n";
+
+local $/ = "\n\n";
+while (readline $input) {
+ /^=head1 EXAMPLES/ ... /^=head1/ or next;
+ /^\h/ or next;
+ chomp;
+
+ my ($name) = /[\h(]*([^|]+)/;
+ ok(qx($_), $name);
+}
+
+done_testing();