Update regression tests, as promised in commit e3a8e7168.

Along the way, fix some conditionals that would behave correctly when
succeeding but report a syntax error when unexpectedly failing.  What
happened was that 'grep -n' would produce no output in the failure
case, and that absence of output in the left half of a shell test
would cause the '-ne' operator to be a syntax error when reached.