-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
20: Added test to guard against issue #20
- Loading branch information
1 parent
77d063c
commit a5a3f50
Showing
3 changed files
with
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// GitHubIssue20Tests.swift | ||
// LazyContainersTests | ||
// | ||
// Created by Ben Leggiero on 2020-07-29. | ||
// | ||
|
||
import XCTest | ||
@testable import LazyContainers | ||
|
||
|
||
|
||
var shouldNotRun = false | ||
|
||
class ShouldNotInit { | ||
init() { | ||
shouldNotRun = true | ||
} | ||
} | ||
|
||
|
||
|
||
/// Guards against issue #20 | ||
/// https://github.com/RougeWare/Swift-Lazy-Patterns/issues/20 | ||
final class GitHubIssue20Tests: XCTestCase { | ||
|
||
@Lazy | ||
var lazyShouldNotRun = ShouldNotInit() | ||
|
||
func testLazyInitWithPropertyWrapper() { | ||
XCTAssertFalse(shouldNotRun) | ||
} | ||
|
||
static var allTests = [ | ||
("testLazyInitWithPropertyWrapper", testLazyInitWithPropertyWrapper) | ||
] | ||
} |
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