Some tests wouldn't compile. I have no idea why
This commit is contained in:
parent
f19f88f3bd
commit
19338ca889
|
@ -3,7 +3,7 @@ import XCTest
|
||||||
|
|
||||||
final class FailableTests: XCTestCase {
|
final class FailableTests: XCTestCase {
|
||||||
func testInit()throws {
|
func testInit()throws {
|
||||||
var story: Failable<String, USPhoneNumber> = try "Hello world...".failable()
|
var story: Failable<String, EmptyValidation<String>> = try "Hello world...".failable()
|
||||||
XCTAssertEqual(story.value, "Hello world...")
|
XCTAssertEqual(story.value, "Hello world...")
|
||||||
|
|
||||||
story = try "Long long ago...".failable()
|
story = try "Long long ago...".failable()
|
||||||
|
@ -11,7 +11,7 @@ final class FailableTests: XCTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
func testSet()throws {
|
func testSet()throws {
|
||||||
var story: Failable<String, USPhoneNumber> = try "Hello world...".failable()
|
var story: Failable<String, EmptyValidation<String>> = try "Hello world...".failable()
|
||||||
try story <~ "Long long ago..."
|
try story <~ "Long long ago..."
|
||||||
|
|
||||||
XCTAssertEqual(story.value, "Long long ago...")
|
XCTAssertEqual(story.value, "Long long ago...")
|
||||||
|
|
|
@ -22,7 +22,7 @@ internal struct LessThan: InRangeValidation {
|
||||||
|
|
||||||
final class ComparableTests: XCTestCase {
|
final class ComparableTests: XCTestCase {
|
||||||
func testNumberThousand()throws {
|
func testNumberThousand()throws {
|
||||||
var int = try Failable<Int, NumberThousand>(5_000)
|
var int = Failable<Int, NumberThousand>(5_000)
|
||||||
|
|
||||||
try int <~ 9_999
|
try int <~ 9_999
|
||||||
try int <~ 1_000
|
try int <~ 1_000
|
||||||
|
@ -32,7 +32,7 @@ final class ComparableTests: XCTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
func testGreaterThan()throws {
|
func testGreaterThan()throws {
|
||||||
var int = try Failable<Int, GreaterThan>(5_000)
|
var int = Failable<Int, GreaterThan>(5_000)
|
||||||
|
|
||||||
try int <~ 1_000
|
try int <~ 1_000
|
||||||
try int <~ 10_000
|
try int <~ 10_000
|
||||||
|
@ -44,7 +44,7 @@ final class ComparableTests: XCTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
func testLessThan()throws {
|
func testLessThan()throws {
|
||||||
var int = try Failable<Int, LessThan>(5_000)
|
var int = Failable<Int, LessThan>(5_000)
|
||||||
|
|
||||||
try int <~ 9_999
|
try int <~ 9_999
|
||||||
try int <~ 999
|
try int <~ 999
|
||||||
|
|
|
@ -5,7 +5,7 @@ typealias OptionalStringLength = NotNilValidate<LengthRange10To1028<String>>
|
||||||
|
|
||||||
final class OptionalTests: XCTestCase {
|
final class OptionalTests: XCTestCase {
|
||||||
func testNotNil()throws {
|
func testNotNil()throws {
|
||||||
var optional = try Failable<Bool?, NotNil<Bool>>(false)
|
var optional = try Failable<Bool?, NotNil<Bool>>.init(false)
|
||||||
|
|
||||||
try optional <~ true
|
try optional <~ true
|
||||||
try optional <~ false
|
try optional <~ false
|
||||||
|
@ -14,7 +14,7 @@ final class OptionalTests: XCTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
func testNotNilValidate()throws {
|
func testNotNilValidate()throws {
|
||||||
var optional = try Failable<String?, OptionalStringLength>("Hello World")
|
var optional = try Failable<String?, OptionalStringLength>.init("Hello World")
|
||||||
|
|
||||||
try optional <~ "Long long ago"
|
try optional <~ "Long long ago"
|
||||||
try optional <~ String(repeating: "x", count: 10)
|
try optional <~ String(repeating: "x", count: 10)
|
||||||
|
|
Loading…
Reference in New Issue