Skip to content

Commit 9bed4e5

Browse files
authored
Merge pull request #11274 from augusto2112/dis-TestClosureShortcuts
[lldb] Disable TestClosureShortcuts
2 parents b6c748b + 63c72f4 commit 9bed4e5

File tree

2 files changed

+34
-12
lines changed

2 files changed

+34
-12
lines changed

lldb/test/API/lang/swift/closure_shortcuts/TestClosureShortcuts.py

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,34 @@
99
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
#
1111
# ------------------------------------------------------------------------------
12-
import lldbsuite.test.lldbinline as lldbinline
12+
from lldbsuite.test.lldbtest import *
1313
from lldbsuite.test.decorators import *
14+
import lldbsuite.test.lldbutil as lldbutil
1415

15-
lldbinline.MakeInlineTest(__file__, globals(),
16-
decorators=[swiftTest])
16+
17+
class TestClosureShortcuts(TestBase):
18+
@swiftTest
19+
def test(self):
20+
self.build()
21+
target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
22+
self, "break here for anonymous variable", lldb.SBFileSpec("main.swift")
23+
)
24+
#
25+
# rdar://159316245
26+
self.runCmd("settings set target.experimental.use-DIL false")
27+
self.expect("expr $0", substrs=["patatino"])
28+
self.expect("expr $1", substrs=["foo"])
29+
self.expect("frame var $0", substrs=["patatino"])
30+
self.expect("frame var $1", substrs=["foo"])
31+
32+
lldbutil.continue_to_source_breakpoint(
33+
self, process, "break here for tinky", lldb.SBFileSpec("main.swift")
34+
)
35+
self.expect("expr [12, 14].map({$0 + 2})", substrs=["[0] = 14", "[1] = 16"])
36+
37+
lldbutil.continue_to_source_breakpoint(
38+
self, process, "break here for outer scope", lldb.SBFileSpec("main.swift")
39+
)
40+
self.expect("expr tinky.map({$0 * 2})", substrs=["[0] = 4", "[1] = 8"])
41+
self.expect("expr [2,4].map({$0 * 2})", substrs=["[0] = 4", "[1] = 8"])
42+
self.expect("expr $0", substrs=["cannot find '$0' in scope"], error=True)

lldb/test/API/lang/swift/closure_shortcuts/main.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,15 @@ func main() -> Int {
1515
let names = ["foo", "patatino"]
1616

1717
var reversedNames = names.sorted(by: {
18-
$0 > $1 } //%self.expect('expr $0', substrs=['patatino'])
19-
//%self.expect('expr $1', substrs=['foo'])
20-
//%self.expect('frame var $0', substrs=['patatino'])
21-
//%self.expect('frame var $1', substrs=['foo'])
22-
)
18+
return $0 > $1 // break here for anonymous variable
19+
})
2320

2421
var tinky = [1,2].map({
25-
$0 * 2 //%self.expect('expr [12, 14].map({$0 + 2})', substrs=['[0] = 14', '[1] = 16'])
22+
$0 * 2 // break here for tinky
2623
})
2724

28-
return 0 //%self.expect('expr tinky.map({$0 * 2})', substrs=['[0] = 4', '[1] = 8'])
29-
//%self.expect('expr [2,4].map({$0 * 2})', substrs=['[0] = 4', '[1] = 8'])
30-
//%self.expect('expr $0', substrs=['cannot find \'$0\' in scope'], error=True)
25+
_ = tinky // break here for outer scope
26+
return 0 // break here for outer scope
3127
}
3228

3329
_ = main()

0 commit comments

Comments
 (0)