-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test to check reimplementation of implisitly unwrapped optinal
- Loading branch information
a.teplyakov
committed
Aug 15, 2018
1 parent
2080870
commit fb6c5c0
Showing
2 changed files
with
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// Test_ImplicitlyUnwrappedOptional.swift | ||
// EasyDi | ||
// | ||
// Created by a.teplyakov on 14/08/2018. | ||
// Copyright © 2018 AndreyZarembo. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import XCTest | ||
import EasyDi | ||
/* | ||
As part of fully implementing (SE–0054), ImplicitlyUnwrappedOptional<T> is now an unavailable typealias of Optional<T>. Declarations annotated with ‘!’ have the type Optional<T>. If an expression involving one of these values will not compile successfully with the type Optional<T>, it is implicitly unwrapped, producing a value of type T. In some cases this will cause code that previously compiled to require updating. Please see this blog post for more information: (Reimplementation of Implicitly Unwrapped Optionals). (33272674) | ||
|
||
https://swift.org/blog/iuo/ | ||
*/ | ||
class Test_ImplicitlyUnwrappedOptional: XCTestCase { | ||
|
||
// Setup | ||
|
||
class ObjectGraphAssembly: Assembly { | ||
|
||
var testObject: TestObject { | ||
return define(init: TestObject.object()) { | ||
return $0 | ||
} | ||
} | ||
} | ||
|
||
class TestObject { | ||
class func object() -> TestObject! { | ||
return TestObject() | ||
} | ||
} | ||
|
||
func testClassInitializator() { | ||
let testObject = ObjectGraphAssembly.instance().testObject | ||
XCTAssertNotNil(testObject) | ||
} | ||
} |