File tree 3 files changed +37
-6
lines changed
Tests/GraphQLTests/LanguageTests
3 files changed +37
-6
lines changed Original file line number Diff line number Diff line change 1
- // swift-tools-version:5.2
1
+ // swift-tools-version:5.4
2
2
import PackageDescription
3
3
4
4
let package = Package (
@@ -18,6 +18,13 @@ let package = Package(
18
18
. product( name: " OrderedCollections " , package : " swift-collections " ) ,
19
19
]
20
20
) ,
21
- . testTarget( name: " GraphQLTests " , dependencies: [ " GraphQL " ] ) ,
21
+ . testTarget(
22
+ name: " GraphQLTests " ,
23
+ dependencies: [ " GraphQL " ] ,
24
+ resources: [
25
+ . copy( " LanguageTests/kitchen-sink.graphql " ) ,
26
+ . copy( " LanguageTests/schema-kitchen-sink.graphql " ) ,
27
+ ]
28
+ ) ,
22
29
]
23
30
)
Original file line number Diff line number Diff line change @@ -249,11 +249,20 @@ class ParserTests: XCTestCase {
249
249
// });
250
250
// });
251
251
252
+ enum ParserTestsError : Error {
253
+ case couldNotFindKitchenSink
254
+ }
255
+
252
256
func testKitchenSink( ) throws {
253
- // let path = "/Users/paulofaria/Development/Zewo/GraphQL/Tests/GraphQLTests/LanguageTests/kitchen-sink.graphql"
254
- // let kitchenSink = try NSString(contentsOfFile: path, encoding:
255
- // String.Encoding.utf8.rawValue)
256
- // _ = try parse(source: kitchenSink as String)
257
+ guard
258
+ let url = Bundle . module. url ( forResource: " kitchen-sink " , withExtension: " graphql " ) ,
259
+ let kitchenSink = try ? String ( contentsOf: url)
260
+ else {
261
+ XCTFail ( " Could not load kitchen sink " )
262
+ return
263
+ }
264
+
265
+ _ = try parse ( source: kitchenSink)
257
266
}
258
267
259
268
func testNonKeywordAsName( ) throws {
Original file line number Diff line number Diff line change @@ -843,4 +843,19 @@ class SchemaParserTests: XCTestCase {
843
843
let result = try parse ( source: source)
844
844
XCTAssert ( result == expected)
845
845
}
846
+
847
+ func testKitchenSink( ) throws {
848
+ guard
849
+ let url = Bundle . module. url (
850
+ forResource: " schema-kitchen-sink " ,
851
+ withExtension: " graphql "
852
+ ) ,
853
+ let kitchenSink = try ? String ( contentsOf: url)
854
+ else {
855
+ XCTFail ( " Could not load kitchen sink " )
856
+ return
857
+ }
858
+
859
+ _ = try parse ( source: kitchenSink)
860
+ }
846
861
}
You can’t perform that action at this time.
0 commit comments