Skip to content

Commit 5e66d3d

Browse files
committed
merge in the fixed tests that will pass once multi-line blockstrings are merged in.
prefixed with “fails_” currently so will not be run.
1 parent 872f837 commit 5e66d3d

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

Tests/GraphQLTests/LanguageTests/SchemaParserTests.swift

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,11 +444,12 @@ class SchemaParserTests : XCTestCase {
444444
type Hello {
445445
world: String
446446
}
447-
"""#
447+
"""#
448448

449449
let expected = Document(
450450
definitions: [
451451
ObjectTypeDefinition(
452+
description: "The Hello type.\nMulti-line description",
452453
name: nameNode("Hello"),
453454
fields: [
454455
fieldNode(
@@ -495,7 +496,7 @@ class SchemaParserTests : XCTestCase {
495496
directive description
496497
"""
497498
directive @Test(a: String = "hello") on FIELD
498-
"""#
499+
"""#
499500
let expected: Document = Document(
500501
definitions: [
501502
DirectiveDefinition(loc: nil,
@@ -682,6 +683,37 @@ class SchemaParserTests : XCTestCase {
682683
let result = try parse(source: source)
683684
XCTAssert(result == expected)
684685
}
686+
687+
func fails_testTypeFieldWithMultilineDescription() throws {
688+
let source = #"""
689+
type Hello {
690+
"""
691+
The world
692+
field.
693+
"""
694+
world: String
695+
}
696+
"""#
697+
698+
let expected = Document(
699+
definitions: [
700+
ObjectTypeDefinition(
701+
name: nameNode("Hello"),
702+
fields: [
703+
fieldNodeWithDescription(
704+
"The world\nfield.",
705+
nameNode("world"),
706+
typeNode("String")
707+
)
708+
]
709+
)
710+
]
711+
)
712+
713+
let result = try parse(source: source)
714+
XCTAssert(result == expected, "\(dump(result)) \n\n\(dump(expected))")
715+
}
716+
685717

686718
func testSimpleInputObjectFieldWithDescription() throws {
687719
let source = #"input Hello { "World field" world: String }"#

0 commit comments

Comments
 (0)