summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2010-12-07 20:52:36 +0000
committerJohnny Chen <johnny.chen@apple.com>2010-12-07 20:52:36 +0000
commit74481444abd336419f91e359f5ffe214a0e4e37a (patch)
treee91fd7a34d75f1dceef8873c0cb95a6d2fcb3035
parentcf096a431af9f3f99ebe5e467e3d0fdc4fbbd5a9 (diff)
downloadbcm5719-llvm-74481444abd336419f91e359f5ffe214a0e4e37a.tar.gz
bcm5719-llvm-74481444abd336419f91e359f5ffe214a0e4e37a.zip
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. llvm-svn: 121183
-rw-r--r--lldb/test/expression_command/test/TestExprs.py27
1 files changed, 24 insertions, 3 deletions
diff --git a/lldb/test/expression_command/test/TestExprs.py b/lldb/test/expression_command/test/TestExprs.py
index 6147979380e..723d1b762aa 100644
--- a/lldb/test/expression_command/test/TestExprs.py
+++ b/lldb/test/expression_command/test/TestExprs.py
@@ -85,10 +85,31 @@ class BasicExprCommandsTestCase(TestBase):
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__':
OpenPOWER on IntegriCloud