]> gitweb.michael.orlitzky.com - hath.git/commitdiff
Fix an incorrect example in the man page.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 14 Oct 2013 01:02:00 +0000 (21:02 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 14 Oct 2013 01:02:00 +0000 (21:02 -0400)
Add shelltestrunner test specs.

doc/man1/hath.1
test/manpage-diffed.test [new file with mode: 0644]
test/manpage-duped.test [new file with mode: 0644]
test/manpage-listed.test [new file with mode: 0644]
test/manpage-reduced.test [new file with mode: 0644]
test/manpage-regexed.test [new file with mode: 0644]
test/manpage-reversed.test [new file with mode: 0644]

index 6e7a618c61adbaaf7ac2cf9ccd0abb85dec56264..c0d6bc004f8eb5f552049e75004ef6aa562cce8b 100644 (file)
@@ -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 (file)
index 0000000..5cd4f67
--- /dev/null
@@ -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 (file)
index 0000000..f2c8bde
--- /dev/null
@@ -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 (file)
index 0000000..e9909bf
--- /dev/null
@@ -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 (file)
index 0000000..10a2f0c
--- /dev/null
@@ -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 (file)
index 0000000..9b09f11
--- /dev/null
@@ -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 (file)
index 0000000..00573fb
--- /dev/null
@@ -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