# HG changeset patch # User catherine@dellzilla # Date 1224879227 14400 # Node ID 3e2651cbe37635be0ae78a4ca25f64993e88f8db # Parent 2d3232693807ad0205636ffb828d86773a5775c4 vigorous whitespace stripping from test results diff -r 2d3232693807 -r 3e2651cbe376 cmd2/cmd2.py --- a/cmd2/cmd2.py Fri Oct 24 16:03:58 2008 -0400 +++ b/cmd2/cmd2.py Fri Oct 24 16:13:47 2008 -0400 @@ -762,9 +762,12 @@ self.cmdapp.onecmd(cmdInput) result = self.outputTrap.read() expected = self.transcriptReader.nextExpected() - self.assertEqual(result.strip(), expected.strip(), + self.assertEqual(self.stripByLine(result), self.stripByLine(expected), '\nFile %s, line %d\nCommand was:\n%s\nExpected:\n%s\nGot:\n%s\n' % (self.transcriptFileName, lineNum, cmdInput, expected, result)) + def stripByLine(self, s): + lines = s.splitlines() + return '\n'.join(line.rstrip() for line in lines).strip() def tearDown(self): if self.CmdApp: self.outputTrap.tearDown() diff -r 2d3232693807 -r 3e2651cbe376 cmd2/exampleSession.txt --- a/cmd2/exampleSession.txt Fri Oct 24 16:03:58 2008 -0400 +++ b/cmd2/exampleSession.txt Fri Oct 24 16:13:47 2008 -0400 @@ -14,7 +14,7 @@ (Cmd) say --shout goodnight, Gracie GOODNIGHT, GRACIE (Cmd) set prompt 'example >>> ' -prompt - was: (Cmd) +prompt - was: (Cmd) now: example >>> example >>> say --repeat 5 spam spam @@ -33,4 +33,5 @@ spam spam spam -spam \ No newline at end of file +spam +example >>> \ No newline at end of file