Skip to content

Commit e89165f

Browse files
committed
Add a testcase that implicitly imports a module in an explicit module build project
1 parent 22968c8 commit e89165f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lldb/test/API/lang/swift/explicit_modules/simple/TestSwiftExplicitModules.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,24 @@
88
class TestSwiftExplicitModules(lldbtest.TestBase):
99

1010
@swiftTest
11-
def test_any_type(self):
11+
def test(self):
1212
"""Test explicit Swift modules"""
1313
self.build()
1414
target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
1515
self, 'Set breakpoint here', lldb.SBFileSpec('main.swift'))
1616

1717
self.expect("expression c", substrs=['hello explicit'])
18+
19+
@swiftTest
20+
@skipUnlessDarwin
21+
def test_import(self):
22+
"""Test an implicit import inside an explicit build"""
23+
self.build()
24+
target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
25+
self, 'Set breakpoint here', lldb.SBFileSpec('main.swift'))
26+
27+
self.expect('expression URL(string: "https://lldb.llvm.org")',
28+
error=True)
29+
self.expect("expression import Foundation")
30+
self.expect('expression URL(string: "https://lldb.llvm.org")',
31+
substrs=["https://lldb.llvm.org"])

0 commit comments

Comments
 (0)