Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add some tests for tesh "output sort".
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 25 Oct 2013 07:58:05 +0000 (09:58 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 28 Oct 2013 11:13:06 +0000 (12:13 +0100)
tools/tesh/set-output-sort.tesh

index 5903494..c2856a2 100644 (file)
@@ -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