summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntaxLiteral.py
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-04-05 22:06:53 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-04-05 22:06:53 +0000
commit9388c4703ba84f7a76472492e6424fa3b64e5331 (patch)
tree337999925a1483ea9e58e9531cbe230be15ae2d7 /lldb/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntaxLiteral.py
parent1dfd74ac4a16a9b18b1c34ec427f5545e1645c13 (diff)
downloadbcm5719-llvm-9388c4703ba84f7a76472492e6424fa3b64e5331.tar.gz
bcm5719-llvm-9388c4703ba84f7a76472492e6424fa3b64e5331.zip
[testsuite] Split Objective-C new syntax test
This splits the second longest test into separate test cases. Similar to what we did for the Objective-C data formatters in r357786. llvm-svn: 357824
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntaxLiteral.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntaxLiteral.py79
1 files changed, 79 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntaxLiteral.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntaxLiteral.py
new file mode 100644
index 00000000000..6516530b807
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntaxLiteral.py
@@ -0,0 +1,79 @@
+"""Test that the Objective-C syntax for dictionary/array literals and indexing works"""
+
+from __future__ import print_function
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+from ObjCNewSyntaxTest import ObjCNewSyntaxTest
+
+
+class ObjCNewSyntaxTestCaseLiteral(ObjCNewSyntaxTest):
+
+ @skipUnlessDarwin
+ @skipIf(macos_version=["<", "10.12"])
+ @expectedFailureAll(archs=["i[3-6]86"])
+ def test_char_literal(self):
+ self.runToBreakpoint()
+
+ self.expect("expr --object-description -- @'a'",
+ VARIABLES_DISPLAYED_CORRECTLY, substrs=[str(ord('a'))])
+
+ @skipUnlessDarwin
+ @skipIf(macos_version=["<", "10.12"])
+ @expectedFailureAll(archs=["i[3-6]86"])
+ def test_integer_literals(self):
+ self.runToBreakpoint()
+
+ self.expect(
+ "expr --object-description -- @1",
+ VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=["1"])
+
+ self.expect(
+ "expr --object-description -- @1l",
+ VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=["1"])
+
+ self.expect(
+ "expr --object-description -- @1ul",
+ VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=["1"])
+
+ self.expect(
+ "expr --object-description -- @1ll",
+ VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=["1"])
+
+ self.expect(
+ "expr --object-description -- @1ull",
+ VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=["1"])
+
+ @skipUnlessDarwin
+ @skipIf(macos_version=["<", "10.12"])
+ @expectedFailureAll(archs=["i[3-6]86"])
+ def test_float_literal(self):
+ self.runToBreakpoint()
+
+ self.expect("expr -- @123.45", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=["NSNumber", "123.45"])
+
+ @skipUnlessDarwin
+ @skipIf(macos_version=["<", "10.12"])
+ @expectedFailureAll(archs=["i[3-6]86"])
+ def test_expressions_in_literals(self):
+ self.runToBreakpoint()
+
+ self.expect(
+ "expr --object-description -- @( 1 + 3 )",
+ VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=["4"])
+ self.expect(
+ "expr -- @((char*)\"Hello world\" + 6)",
+ VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=[
+ "NSString",
+ "world"])
OpenPOWER on IntegriCloud