[Lldb-commits] [lldb] r121183 - /lldb/trunk/test/expression_command/test/TestExprs.py
Johnny Chen
johnny.chen at apple.com
Tue Dec 7 12:52:36 PST 2010
Author: johnny
Date: Tue Dec 7 14:52:36 2010
New Revision: 121183
URL: http://llvm.org/viewvc/llvm-project?rev=121183&view=rev
Log:
Add a test sequence for test_expr_commands_can_handle_quotes(self):
# runCmd: command alias print_hi expression printf ("\n\tHi!")
# output:
self.runCmd('command alias print_hi expression printf ("\\n\\tHi!")')
# This fails currently.
self.runCmd('print_hi')
and modify existing test sequences to escape the escape character '\ to prevent it
from being interpreted by Python before passing on to the lldb command interpreter.
Modified:
lldb/trunk/test/expression_command/test/TestExprs.py
Modified: lldb/trunk/test/expression_command/test/TestExprs.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/test/TestExprs.py?rev=121183&r1=121182&r2=121183&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/test/TestExprs.py (original)
+++ lldb/trunk/test/expression_command/test/TestExprs.py Tue Dec 7 14:52:36 2010
@@ -85,10 +85,31 @@
self.runCmd("run", RUN_SUCCEEDED)
+ # runCmd: expression 'a'
+ # output: (char) $0 = 'a'
self.runCmd("expression 'a'")
- self.runCmd('expression printf("\t\x68\n")')
- self.runCmd('expression printf("\"\n")')
- self.runCmd('expression printf("\'\n")')
+
+ # runCmd: expression printf ("\n\n\tHello there!")
+ # output: (unsigned long) $1 = 15
+ self.runCmd('expression printf ("\\n\\n\\tHello there!")')
+
+ # runCmd: expression printf("\t\x68\n")
+ # output: (unsigned long) $2 = 3
+ self.runCmd('expression printf("\\t\\x68\\n")')
+
+ # runCmd: expression printf("\"\n")
+ # output: (unsigned long) $3 = 2
+ self.runCmd('expression printf("\\"\\n")')
+
+ # runCmd: expression printf("'\n")
+ # output: (unsigned long) $4 = 2
+ self.runCmd('expression printf("\'\\n")')
+
+ # runCmd: command alias print_hi expression printf ("\n\tHi!")
+ # output:
+ self.runCmd('command alias print_hi expression printf ("\\n\\tHi!")')
+ # This fails currently.
+ self.runCmd('print_hi')
if __name__ == '__main__':
More information about the lldb-commits
mailing list