X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f783ed4680c6862a1b7543237e89d1221334bae0..cf74de4a878beaa5177d7ea2fc4e11b550240559:/tools/tesh/basic.tesh diff --git a/tools/tesh/basic.tesh b/tools/tesh/basic.tesh index d26a68ee98..db3d8f7e1e 100644 --- a/tools/tesh/basic.tesh +++ b/tools/tesh/basic.tesh @@ -9,10 +9,17 @@ $ mkfile tmp_fich $ cat tmp_fich > TOTO TUTU +! expect return 2 +! output ignore +< $ cat tmp_fich +< > TUTU TOTO +$ ${bindir:=.}/tesh + $ rm tmp_fich p And now, some multilines examples +p Really basic multiline < a < b < c @@ -25,21 +32,132 @@ $ cat tmp_fich > c > d -$ wc -l tmp_fich -> 4 tmp_fich +$ sed -n '$=' tmp_fich +> 4 $ rm tmp_fich -$ ${bindir:=.}/tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' basic2.tesh -> Enable coverage -> Test suite `basic2' -> [basic2:3] Test sorting and filtering of output -> [basic2:5] printf 'a\\nb\\nc\\nd\\n' -> [basic2:11] printf 'a\\nb\\nc\\nd' -> [basic2:18] printf 'c\\nd\\nb\\na\\n' -> [basic2:25] printf 'c\\nd\\nb\\na' -> [basic2:31] printf 'a\\nprofiling: foo\\nprofiling: bar\\nb\\nc\\nd\\nprofiling: baz\\n' -> [basic2:37] printf 'a\\nprofiling: foo\\nprofiling: bar\\nb\\nc\\nd\\nprofiling: baz' -> [basic2:44] printf 'c\\nprofiling: foo\\nprofiling: bar\\nd\\nb\\na\\nprofiling: baz\\n' -> [basic2:51] printf 'c\\nprofiling: foo\\nprofiling: bar\\nd\\nb\\na\\nprofiling: baz' -> Test suite `basic2' OK +p Now, check for spaces in input + +p * leading and trailing spaces... +< a +< b +< c +$ sed 's/ /_/g' +> __a +> _b_ +> c__ + +p * empty lines... +< a +< +< c +$ sed '2s/^/b/' +> a +> b +> c + +< +< b +< c +$ sed '1s/^/a/' +> a +> b +> c + +p Now that input should be good, check for spaces in output + +p * leading spaces... +< _x +$ sed 's/_/ /' +> x + +! expect return 2 +! output ignore +< < _x +< $ sed 's/_/ /' +< > x +$ ${bindir:=.}/tesh + +! expect return 2 +! output ignore +< < x +< $ cat +< > x +$ ${bindir:=.}/tesh + +p * trailing spaces... +< x_ +$ sed 's/_/ /' +> x + +! expect return 2 +! output ignore +< < x_ +< $ sed 's/_/ /' +< > x +$ ${bindir:=.}/tesh + +! expect return 2 +! output ignore +< < x +< $ cat +< > x +$ ${bindir:=.}/tesh + +p * empty lines... +< a +< +< c +$ cat +> a +> +> c + +! expect return 2 +! output ignore +< < a +< < +< < c +< $ cat +< > a +< > c +$ ${bindir:=.}/tesh + +! expect return 2 +! output ignore +< < a +< < c +< $ cat +< > a +< > +< > c +$ ${bindir:=.}/tesh + +< +< b +< c +$ cat +> +> b +> c + +! expect return 2 +! output ignore +< < +< < b +< < c +< $ cat +< > b +< > c +$ ${bindir:=.}/tesh + +! expect return 2 +! output ignore +< < b +< < c +< $ cat +< > +< > b +< > c +$ ${bindir:=.}/tesh