File tree Expand file tree Collapse file tree 1 file changed +34
-2
lines changed
Tests/GraphQLTests/LanguageTests Expand file tree Collapse file tree 1 file changed +34
-2
lines changed Original file line number Diff line number Diff 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. \n Multi-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 \n field. " ,
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 }"#
You can’t perform that action at this time.
0 commit comments