-
-
Notifications
You must be signed in to change notification settings - Fork 621
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enabled lookup for generic type information in arrays (#1346)
* Enabled lookup for generic type information in arrays * Added unit test
- Loading branch information
Showing
3 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import Quick | ||
import Nimble | ||
#if SWIFT_PACKAGE | ||
@testable import SourceryLib | ||
#else | ||
@testable import Sourcery | ||
#endif | ||
@testable import SourceryRuntime | ||
|
||
class ArrayTypeSpec: QuickSpec { | ||
override func spec() { | ||
describe("Array") { | ||
var sut: ArrayType? | ||
|
||
beforeEach { | ||
sut = ArrayType(name: "Foo", elementTypeName: TypeName(name: "Foo"), elementType: Type(name: "Bar")) | ||
} | ||
|
||
afterEach { | ||
sut = nil | ||
} | ||
|
||
it("preserves element type for generic") { | ||
expect(sut?.asGeneric.typeParameters.first?.type).toNot(beNil()) | ||
} | ||
} | ||
} | ||
} |