Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
leak --(cherry picked from commit dd1330c53beec9c5abb8b23375062e6acf214632)
[simgrid.git] / 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