Skip to content

Commit

Permalink
Merge pull request #61 from CodaFi/upper-crust
Browse files Browse the repository at this point in the history
Update to Swift 3.1
  • Loading branch information
CodaFi authored Mar 29, 2017
2 parents 7945839 + fc28e3d commit 0d481bb
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ matrix:
include:
- os: osx
language: objective-c
osx_image: xcode8
osx_image: xcode8.3
before_install:
- git submodule update --init --recursive
script:
Expand All @@ -14,7 +14,7 @@ matrix:
- carthage build --no-skip-current
- os: osx
language: objective-c
osx_image: xcode8
osx_image: xcode8.3
before_install:
- git submodule update --init --recursive
script:
Expand All @@ -41,9 +41,9 @@ matrix:
before_install:
- git submodule update --init --recursive
- wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import -
- wget https://swift.org/builds/swift-3.0-release/ubuntu1404/swift-3.0-RELEASE/swift-3.0-RELEASE-ubuntu14.04.tar.gz
- tar xzf swift-3.0-RELEASE-ubuntu14.04.tar.gz
- export PATH=${PWD}/swift-3.0-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
- wget https://swift.org/builds/swift-3.1-release/ubuntu1404/swift-3.1-RELEASE/swift-3.1-RELEASE-ubuntu14.04.tar.gz
- tar xzf swift-3.1-RELEASE-ubuntu14.04.tar.gz
- export PATH=${PWD}/swift-3.1-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
script:
- swift build
notifications:
Expand Down
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "typelift/Operadics" "0.2.2"
github "typelift/SwiftCheck" "v0.7.0"
github "typelift/SwiftCheck" "0.8.0"
2 changes: 1 addition & 1 deletion Carthage/Checkouts/SwiftCheck
Submodule SwiftCheck updated 54 files
+2 −0 .gitignore
+1 −0 .swift-version
+18 −11 .travis.yml
+14 −13 README.md
+19 −32 Sources/Arbitrary.swift
+896 −0 Sources/Cartesian.swift
+1 −1 Sources/CoArbitrary.swift
+2 −2 Sources/Compose.swift
+108 −216 Sources/Gen.swift
+10 −5 Sources/Lattice.swift
+55 −26 Sources/Modifiers.swift
+3 −3 Sources/Property.swift
+17 −8 Sources/Random.swift
+13 −13 Sources/Rose.swift
+1 −1 Sources/Test.swift
+8 −6 Sources/Testable.swift
+2 −2 SwiftCheck.podspec
+187 −123 SwiftCheck.xcodeproj/project.pbxproj
+1 −1 SwiftCheck.xcodeproj/xcshareddata/xcschemes/SwiftCheck-iOS.xcscheme
+1 −1 SwiftCheck.xcodeproj/xcshareddata/xcschemes/SwiftCheck-tvOS.xcscheme
+1 −1 SwiftCheck.xcodeproj/xcshareddata/xcschemes/SwiftCheck.xcscheme
+62 −0 Templates/Cartesian.swift.gyb
+54 −0 Templates/CartesianSpec.swift.gyb
+0 −60 Tests/BooleanIdentitySpec.swift
+0 −79 Tests/ComplexSpec.swift
+0 −28 Tests/DiscardSpec.swift
+0 −348 Tests/GenSpec.swift
+30 −0 Tests/LinuxMain.swift
+0 −63 Tests/ModifierSpec.swift
+0 −171 Tests/PropertySpec.swift
+0 −36 Tests/RawRepresentableSpec.swift
+0 −41 Tests/ShrinkSpec.swift
+88 −0 Tests/SwiftCheckTests/BooleanIdentitySpec.swift
+264 −0 Tests/SwiftCheckTests/CartesianSpec.swift
+93 −0 Tests/SwiftCheckTests/ComplexSpec.swift
+40 −0 Tests/SwiftCheckTests/DiscardSpec.swift
+13 −0 Tests/SwiftCheckTests/FailureSpec.swift
+1,212 −0 Tests/SwiftCheckTests/FileCheck.swift
+88 −0 Tests/SwiftCheckTests/FormatterSpec.swift
+462 −0 Tests/SwiftCheckTests/GenSpec.swift
+9 −2 Tests/SwiftCheckTests/LambdaSpec.swift
+93 −0 Tests/SwiftCheckTests/ModifierSpec.swift
+14 −8 Tests/SwiftCheckTests/PathSpec.swift
+227 −0 Tests/SwiftCheckTests/PropertySpec.swift
+7 −1 Tests/SwiftCheckTests/ReplaySpec.swift
+8 −1 Tests/SwiftCheckTests/RoseSpec.swift
+73 −0 Tests/SwiftCheckTests/ShrinkSpec.swift
+91 −71 Tests/SwiftCheckTests/SimpleSpec.swift
+79 −0 Tests/SwiftCheckTests/TestSpec.swift
+0 −54 Tests/TestSpec.swift
+14 −14 Tutorial.playground/Contents.swift
+4 −0 Utilities/compile.sh
+3 −0 Utilities/gyb
+1,146 −0 Utilities/gyb.py
3 changes: 3 additions & 0 deletions Swiftx.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@
84A88D2E1A70BF0A003D53CF /* SwiftxTests */,
84A88C8A1A70BD71003D53CF /* Products */,
);
indentWidth = 4;
sourceTree = "<group>";
tabWidth = 4;
usesTabs = 1;
};
84A88C8A1A70BD71003D53CF /* Products */ = {
isa = PBXGroup;
Expand Down
17 changes: 17 additions & 0 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// LinuxMain.swift
// SwiftCheck
//
// Created by Robert Widmann on 9/18/16.
// Copyright © 2016 Typelift. All rights reserved.
//

import XCTest

@testable import SwiftxTests

#if !os(macOS)
XCTMain([
EitherSpec.allTests,
])
#endif
12 changes: 9 additions & 3 deletions Tests/SwiftxTests/EitherSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import SwiftCheck

extension Either where L : Arbitrary, R : Arbitrary {
static var arbitrary : Gen<Either<L, R>> {
return Gen.oneOf([
return Gen.one(of: [
L.arbitrary.map(Either.Left),
R.arbitrary.map(Either.Right),
])
])
}

static func shrink(_ e : Either<L, R>) -> [Either<L, R>] {
Expand Down Expand Up @@ -56,7 +56,7 @@ class EitherSpec : XCTestCase {
property("isRight behaves") <- forAllShrink(Either<Int, Int>.arbitrary, shrinker: Either.shrink) { e in
return e.isRight == e.fold(false, f: const(true))
}

property("left and right behave") <- forAllShrink(Either<Int, Int>.arbitrary, shrinker: Either.shrink) { e in
return (e.isLeft && e.left != nil) || (e.isRight && e.right != nil)
}
Expand Down Expand Up @@ -85,4 +85,10 @@ class EitherSpec : XCTestCase {
}
}
}

#if !(os(macOS) || os(iOS) || os(watchOS) || os(tvOS))
static var allTests = testCase([
("testProperties", testProperties),
])
#endif
}

0 comments on commit 0d481bb

Please sign in to comment.