File tree Expand file tree Collapse file tree 3 files changed +37
-6
lines changed
Tests/GraphQLTests/LanguageTests Expand file tree Collapse file tree 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
22import PackageDescription
33
44let package = Package (
@@ -18,6 +18,13 @@ let package = Package(
1818 . product( name: " OrderedCollections " , package : " swift-collections " ) ,
1919 ]
2020 ) ,
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+ ) ,
2229 ]
2330)
Original file line number Diff line number Diff line change @@ -249,11 +249,20 @@ class ParserTests: XCTestCase {
249249// });
250250 // });
251251
252+ enum ParserTestsError : Error {
253+ case couldNotFindKitchenSink
254+ }
255+
252256 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)
257266 }
258267
259268 func testNonKeywordAsName( ) throws {
Original file line number Diff line number Diff line change @@ -843,4 +843,19 @@ class SchemaParserTests: XCTestCase {
843843 let result = try parse ( source: source)
844844 XCTAssert ( result == expected)
845845 }
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+ }
846861}
You can’t perform that action at this time.
0 commit comments