From 94bdb0c04f4c860a9fee1d841cfd2eec46ec139a Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 25 Oct 2013 09:58:05 +0200 Subject: [PATCH] Add some tests for tesh "output sort". --- tools/tesh/set-output-sort.tesh | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tools/tesh/set-output-sort.tesh b/tools/tesh/set-output-sort.tesh index 5903494505..c2856a2f7f 100644 --- a/tools/tesh/set-output-sort.tesh +++ b/tools/tesh/set-output-sort.tesh @@ -21,3 +21,53 @@ $ ${bindir:=.}/tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' set- > [set-output-sort-1:57] printf 'c\\nprofiling: foo\\nprofiling: bar\\nd\\nb\\na\\nprofiling: baz\\n' > [set-output-sort-1:64] printf 'c\\nprofiling: foo\\nprofiling: bar\\nd\\nb\\na\\nprofiling: baz' > Test suite `set-output-sort-1' OK + +p Check the default prefix length (19) for "output sort" +! output sort +< 12345678901234567 B line +< 12345678901234567 A line +$ cat +> 12345678901234567 A line +> 12345678901234567 B line + +! output sort +< 123456789012345678 B line +< 123456789012345678 A line +$ cat +> 123456789012345678 B line +> 123456789012345678 A line + +! expect return 2 +! output ignore +< ! output sort +< < 123456789012345678 B line +< < 123456789012345678 A line +< $ cat +< > 123456789012345678 A line +< > 123456789012345678 B line +$ ${bindir:=.}/tesh --enable-coverage + +p Check user-defined prefix length for "output sort" +! output sort 5 +< 000 B line +< 000 A line +$ cat +> 000 A line +> 000 B line + +! output sort 4 +< 000 B line +< 000 A line +$ cat +> 000 B line +> 000 A line + +! expect return 2 +! output ignore +< ! output sort 4 +< < 000 B line +< < 000 A line +< $ cat +< > 000 A line +< > 000 B line +$ ${bindir:=.}/tesh --enable-coverage -- 2.20.1