X-Git-Url: https://gitweb.michael.orlitzky.com/?p=hath.git;a=blobdiff_plain;f=test%2Fshell%2Fmanpage-sort.test;h=845aaedd6cf20dd94872035436c9db001243ef78;hp=56dd0254aaa83da354e82f6a06773c34e0173272;hb=2404313e648301064041c12fdab8d2f976c26a64;hpb=097949fec1de71ad9f7d94dc16980c8ca4a18640 diff --git a/test/shell/manpage-sort.test b/test/shell/manpage-sort.test index 56dd025..845aaed 100644 --- a/test/shell/manpage-sort.test +++ b/test/shell/manpage-sort.test @@ -1,7 +1,22 @@ -# Test the pipe-to-sort example from the man page. +# Test --sort example from the man page. -echo "192.168.0.100/24 192.167.1.200/24" | dist/build/hath/hath reduced | sort +# The default pipe-to-sort doesn't work. +echo "10.0.121.32/28 10.0.93.248/29" | dist/build/hath/hath reduced | sort >>> -192.167.1.200/24 -192.168.0.100/24 +10.0.121.32/28 +10.0.93.248/29 +>>>= 0 + +# Neither does a numeric sort. +echo "10.0.121.32/28 10.0.93.248/29" | dist/build/hath/hath reduced | sort -n +>>> +10.0.121.32/28 +10.0.93.248/29 +>>>= 0 + +# But the CIDR sort order does. +echo "10.0.121.32/28 10.0.93.248/29" | dist/build/hath/hath reduced --sort +>>> +10.0.93.248/29 +10.0.121.32/28 >>>= 0