Skip to content

Commit dbaff27

Browse files
authored
Merge pull request #25 from SportlabsTechnology/master
Update .swift-version and travis config to swift 4.2
2 parents e6c8205 + 04b5ffb commit dbaff27

File tree

7 files changed

+43
-95
lines changed

7 files changed

+43
-95
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1
1+
4.2

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ matrix:
55
include:
66
- os: osx
77
env: JOB=SwiftPM_OSX
8-
osx_image: xcode9.3beta
8+
osx_image: xcode10.1
99
- os: linux
1010
env: JOB=SwiftPM_linux
1111
dist: trusty

Package.resolved

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,44 @@
66
"repositoryURL": "https://github.com/vapor/core.git",
77
"state": {
88
"branch": null,
9-
"revision": "174f909bc048a6aff27d6cb4c31810971f912cca",
10-
"version": "3.2.2"
9+
"revision": "1794ff138bd669175a2528d27695028d7cb30471",
10+
"version": "3.5.0"
11+
}
12+
},
13+
{
14+
"package": "CRuntime",
15+
"repositoryURL": "https://github.com/wickwirew/CRuntime.git",
16+
"state": {
17+
"branch": null,
18+
"revision": "8d0dd0ca3787d15682c1f44de3d298459870b121",
19+
"version": "1.0.0"
1120
}
1221
},
1322
{
1423
"package": "GraphQL",
1524
"repositoryURL": "https://github.com/GraphQLSwift/GraphQL.git",
1625
"state": {
17-
"branch": null,
18-
"revision": "1ab3c9050cb0aea4350dbc343454bb8c83adff34",
19-
"version": "0.6.0"
26+
"branch": "master",
27+
"revision": "2ba73c3691dbcdeb6e09ad4f6df46536ba692c83",
28+
"version": null
2029
}
2130
},
2231
{
2332
"package": "Runtime",
2433
"repositoryURL": "https://github.com/wickwirew/Runtime.git",
2534
"state": {
2635
"branch": null,
27-
"revision": "23357609f0df427d870bb4bd22ac14e0a4ea1346",
28-
"version": "0.7.1"
36+
"revision": "40cdfbad9650512507c060824e1c4e9fc2ca721d",
37+
"version": "1.1.0"
2938
}
3039
},
3140
{
3241
"package": "swift-nio",
3342
"repositoryURL": "https://github.com/apple/swift-nio.git",
3443
"state": {
3544
"branch": null,
36-
"revision": "695afc5205aaa49fca092b94b479ff71c43d9d3c",
37-
"version": "1.8.0"
45+
"revision": "03c541a24dd0558c942b15d8464eb75d70a921c4",
46+
"version": "1.12.1"
3847
}
3948
},
4049
{

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:4.0
1+
// swift-tools-version:4.2
22
import PackageDescription
33

44
let package = Package(
@@ -9,7 +9,7 @@ let package = Package(
99
],
1010

1111
dependencies: [
12-
.package(url: "https://github.com/GraphQLSwift/GraphQL.git", from: "0.6.0"),
12+
.package(url: "https://github.com/GraphQLSwift/GraphQL.git", from: "0.8.0"),
1313
],
1414

1515
targets: [

Tests/GraphitiTests/StarWarsTests/StarWarsData.swift

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -210,23 +210,26 @@ func search(for value: String) -> [SearchResult] {
210210
let value = value.lowercased()
211211
var result: [SearchResult] = []
212212

213-
result.append(contentsOf:
214-
planetData.filter({
215-
return $1.name.lowercased().range(of:value) != nil
216-
}).map({ $1 })
217-
)
218-
219-
result.append(contentsOf:
220-
humanData.filter({
221-
return $1.name.lowercased().range(of:value) != nil
222-
}).map({ $1 })
223-
)
224-
225-
result.append(contentsOf:
226-
droidData.filter({
227-
return $1.name.lowercased().range(of:value) != nil
228-
}).map({ $1 })
229-
)
213+
// Due to randomness of hash values introduced by https://github.com/apple/swift-evolution/blob/master/proposals/0206-hashable-enhancements.md
214+
// we should iterate over sorted keys here otherwise the order of output is random and the tests sometimes fails.
215+
216+
planetData.keys.sorted().forEach {
217+
if planetData[$0]?.name.lowercased().range(of:value) != nil {
218+
result.append(planetData[$0]!)
219+
}
220+
}
221+
222+
humanData.keys.sorted().forEach {
223+
if humanData[$0]?.name.lowercased().range(of:value) != nil {
224+
result.append(humanData[$0]!)
225+
}
226+
}
227+
228+
droidData.keys.sorted().forEach {
229+
if droidData[$0]?.name.lowercased().range(of:value) != nil {
230+
result.append(droidData[$0]!)
231+
}
232+
}
230233

231234
return result
232235
}

Tests/GraphitiTests/StarWarsTests/StarWarsIntrospectionTests.swift

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class StarWarsIntrospectionTests : XCTestCase {
1818
" }" +
1919
"}"
2020

21-
#if os(macOS)
2221
let expected: Map = [
2322
"data": [
2423
"__schema": [
@@ -81,70 +80,6 @@ class StarWarsIntrospectionTests : XCTestCase {
8180
],
8281
],
8382
]
84-
#else
85-
let expected: Map = [
86-
"data": [
87-
"__schema": [
88-
"types": [
89-
[
90-
"name": "__Directive",
91-
],
92-
[
93-
"name": "__DirectiveLocation",
94-
],
95-
[
96-
"name": "__EnumValue",
97-
],
98-
[
99-
"name": "__Field",
100-
],
101-
[
102-
"name": "__InputValue",
103-
],
104-
[
105-
"name": "__Schema",
106-
],
107-
[
108-
"name": "__Type",
109-
],
110-
[
111-
"name": "__TypeKind",
112-
],
113-
[
114-
"name": "Boolean",
115-
],
116-
[
117-
"name": "Character",
118-
],
119-
[
120-
"name": "Droid",
121-
],
122-
[
123-
"name": "Episode",
124-
],
125-
[
126-
"name": "Human",
127-
],
128-
[
129-
"name": "Int",
130-
],
131-
[
132-
"name": "Planet",
133-
],
134-
[
135-
"name": "Query",
136-
],
137-
[
138-
"name": "SearchResult",
139-
],
140-
[
141-
"name": "String",
142-
],
143-
],
144-
],
145-
],
146-
]
147-
#endif
14883

14984
let result = try starWarsSchema.execute(request: query, eventLoopGroup: eventLoopGroup).wait()
15085
XCTAssertEqual(result, expected)

Tests/GraphitiTests/StarWarsTests/StarWarsQueryTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ class StarWarsQueryTests : XCTestCase {
609609
]
610610

611611
let result = try starWarsSchema.execute(request: query, eventLoopGroup: eventLoopGroup).wait()
612+
612613
XCTAssertEqual(result, expected)
613614
}
614615
}

0 commit comments

Comments
 (0)