Files
swift-mirror/test/ImportResolution/import-command-line.swift
Brent Royal-Gordon f71923778b Add -testable-import-module frontend flag
This is just like -import-module, but it does an @testable import. Simple, right?

Fixes rdar://66544654.
2020-10-09 18:59:20 -07:00

15 lines
1.0 KiB
Swift

// RUN: %target-swift-frontend -typecheck %s -enable-source-import -I %S/Inputs -sdk "" -verify
// RUN: %target-swift-frontend -typecheck %s -enable-source-import -I %S/Inputs -sdk "" -import-module abcde
// RUN: not %target-swift-frontend -typecheck %s -enable-source-import -I %S/Inputs -sdk "" -import-module 3333 2>&1 | %FileCheck -check-prefix=NON-IDENT %s
// NON-IDENT: error: module name "3333" is not a valid identifier
// RUN: not %target-swift-frontend -typecheck %s -enable-source-import -I %S/Inputs -sdk "" -import-module NON_EXISTENT 2>&1 | %FileCheck -check-prefix=NON-EXISTENT %s
// NON-EXISTENT: error: no such module 'NON_EXISTENT'
// RUN: not %target-swift-frontend -typecheck %s -enable-source-import -I %S/Inputs -sdk "" -testable-import-module abcde 2>&1 | %FileCheck -check-prefix=NON-TESTABLE %s
// NON-TESTABLE: error: module 'abcde' was not compiled for testing
var a: A? // expected-error {{cannot find type 'A' in scope}}
var qA: abcde.A? // expected-error {{cannot find type 'abcde' in scope}}