testsuite expect patterns matching tabs

Stan Shebs shebs@cygnus.com
Fri Aug 13 12:07:00 GMT 1999


   From: jtc@redback.com (J.T. Conklin)
   Date: 13 Aug 1999 11:33:37 -0700

   The test in question is correct.  Gdb emits a tab, but since tabs are
   expanded to spaces, the expect pattern fails.  However, I don't know
   whether its appropriate to relax the test (or tests --- I haven't had
   time to look at any of the other failures) or to change the test
   harness to change the pty attributes.

There are very few circumstances in which the testsuite ought to be
picky about the number of spaces in the output (column-formatted
output, perhaps).  The rest of the time the tests should be accepting
any combination of whitespace.  Some of the test files do a clever
thing by putting the complicated regexp into a variable, such as in
virtfunc.exp:

	set ws "\[\r\n\t \]+"

It looks a little funky to have ${ws} scattered through an expression,
but the expression is shorter and easier to read, and the matching
rules are more uniform.

								Stan

PS On the other hand, many tests expect exactly one blank in various
places, and GDB will likely always issue one blank - in those cases
there's no need to go overboard and replace with a ${ws}.


More information about the Gdb mailing list