From: Michael Orlitzky Date: Mon, 14 Oct 2013 01:02:00 +0000 (-0400) Subject: Fix an incorrect example in the man page. X-Git-Tag: 0.1.1~8 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=b60a55a3e5ed9b9c3fa58405832bda095bb89d60;p=hath.git Fix an incorrect example in the man page. Add shelltestrunner test specs. --- diff --git a/doc/man1/hath.1 b/doc/man1/hath.1 index 6e7a618..c0d6bc0 100644 --- a/doc/man1/hath.1 +++ b/doc/man1/hath.1 @@ -40,9 +40,8 @@ This computes a (Perl-compatible) regular expression matching the input CIDR blocks. It's the default mode of operation. .P .nf -.I $ hath <<< \(dq10.0.0.0/24 10.0.1.0/24\(dq -([^\.0-9](10)\.(0)\.(0)\.(0)[^\.0-9]|[^\.0-9](10)\.(0)\.(1) -\.(0)[^\.0-9]) +.I $ hath <<< \(dq10.0.0.0/29 10.0.0.8/29\(dq +((10)\.(0)\.(0)\.(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15)) .fi .IP \(bu 2 \fBReduced\fR diff --git a/test/manpage-diffed.test b/test/manpage-diffed.test new file mode 100644 index 0000000..5cd4f67 --- /dev/null +++ b/test/manpage-diffed.test @@ -0,0 +1,7 @@ +# Test the regexed example from the man page. +dist/build/hath/hath diffed <<< "10.0.0.0/24 10.0.1.0/24" +>>> +-10.0.0.0/24 +-10.0.1.0/24 ++10.0.0.0/23 +>>>= 0 diff --git a/test/manpage-duped.test b/test/manpage-duped.test new file mode 100644 index 0000000..f2c8bde --- /dev/null +++ b/test/manpage-duped.test @@ -0,0 +1,6 @@ +# Test the regexed example from the man page. +dist/build/hath/hath duped <<< "10.0.0.0/24 10.0.1.0/24" +>>> +10.0.0.0/24 +10.0.1.0/24 +>>>= 0 diff --git a/test/manpage-listed.test b/test/manpage-listed.test new file mode 100644 index 0000000..e9909bf --- /dev/null +++ b/test/manpage-listed.test @@ -0,0 +1,12 @@ +# Test the regexed example from the man page. +dist/build/hath/hath listed <<< "192.168.0.240/29" +>>> +192.168.0.240 +192.168.0.241 +192.168.0.242 +192.168.0.243 +192.168.0.244 +192.168.0.245 +192.168.0.246 +192.168.0.247 +>>>= 0 diff --git a/test/manpage-reduced.test b/test/manpage-reduced.test new file mode 100644 index 0000000..10a2f0c --- /dev/null +++ b/test/manpage-reduced.test @@ -0,0 +1,5 @@ +# Test the reduced example from the man page. +dist/build/hath/hath reduced <<< "10.0.0.0/24 10.0.1.0/24" +>>> +10.0.0.0/23 +>>>= 0 diff --git a/test/manpage-regexed.test b/test/manpage-regexed.test new file mode 100644 index 0000000..9b09f11 --- /dev/null +++ b/test/manpage-regexed.test @@ -0,0 +1,5 @@ +# Test the regexed example from the man page. +dist/build/hath/hath <<< "10.0.0.0/29 10.0.0.8/29" +>>> +((10)\.(0)\.(0)\.(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15)) +>>>= 0 diff --git a/test/manpage-reversed.test b/test/manpage-reversed.test new file mode 100644 index 0000000..00573fb --- /dev/null +++ b/test/manpage-reversed.test @@ -0,0 +1,8 @@ +# Test the regexed example from the man page. +dist/build/hath/hath reversed <<< "198.41.0.4/30" +>>> +198.41.0.4: a.root-servers.net. +198.41.0.5: +198.41.0.6: rs.internic.net. +198.41.0.7: +>>>= 0