+
+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