Skip to content

Commit dee12dc

Browse files
committed
[stdlib] Update tests for new String documentation
In addition to a new test fixture for 'SourceKit/DocSupport/ doc_clang_module.swift', this removes the check for an ASCII-only generated standard library interface from 'SourceKit/InterfaceGen/ gen_stdlib.swift'.
1 parent 44b2d56 commit dee12dc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/SourceKit/DocSupport/doc_clang_module.swift.response

+1-1
Original file line numberDiff line numberDiff line change
@@ -5690,7 +5690,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
56905690
key.name: "init(arrayLiteral:)",
56915691
key.usr: "s:FEsPs10SetAlgebracFt12arrayLiteralGSawx7Element__x::SYNTHESIZED::c:@E@FooRuncingOptions",
56925692
key.original_usr: "s:FEsPs10SetAlgebracFt12arrayLiteralGSawx7Element__x",
5693-
key.doc.full_as_xml: "<Function><Name>init(arrayLiteral:)</Name><USR>s:FEsPs10SetAlgebracFt12arrayLiteralGSawx7Element__x</USR><Declaration>convenience init(arrayLiteral: Self.Element...)</Declaration><Abstract><Para>Creates a set containing the elements of the given array literal.</Para></Abstract><Parameters><Parameter><Name>arrayLiteral</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>A list of elements of the new set.</Para></Discussion></Parameter></Parameters><Discussion><Para>Don’t directly call this initializer, which is used by the compiler when you use an array literal. Instead, create a new set using an array literal as its value by enclosing a comma-separated list of values in square brackets. You can use an array literal anywhere a set is expected by the type context.</Para><Para>Here, a set of strings is created from an array literal holding only strings:</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[let ingredients: Set = [\"cocoa beans\", \"sugar\", \"cocoa butter\", \"salt\"]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[if ingredients.isSuperset(of: [\"sugar\", \"salt\"]) {]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[ print(\"Whatever it is, it's bound to be delicious!\")]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[}]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"Whatever it is, it's bound to be delicious!\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing></Discussion></Function>",
5693+
key.doc.full_as_xml: "<Function><Name>init(arrayLiteral:)</Name><USR>s:FEsPs10SetAlgebracFt12arrayLiteralGSawx7Element__x</USR><Declaration>convenience init(arrayLiteral: Self.Element...)</Declaration><Abstract><Para>Creates a set containing the elements of the given array literal.</Para></Abstract><Parameters><Parameter><Name>arrayLiteral</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>A list of elements of the new set.</Para></Discussion></Parameter></Parameters><Discussion><Para>Do not call this initializer directly. It is used by the compiler when you use an array literal. Instead, create a new set using an array literal as its value by enclosing a comma-separated list of values in square brackets. You can use an array literal anywhere a set is expected by the type context.</Para><Para>Here, a set of strings is created from an array literal holding only strings:</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[let ingredients: Set = [\"cocoa beans\", \"sugar\", \"cocoa butter\", \"salt\"]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[if ingredients.isSuperset(of: [\"sugar\", \"salt\"]) {]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[ print(\"Whatever it is, it's bound to be delicious!\")]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[}]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"Whatever it is, it's bound to be delicious!\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing></Discussion></Function>",
56945694
key.offset: 2240,
56955695
key.length: 65,
56965696
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.keyword>convenience</syntaxtype.keyword> <syntaxtype.keyword>init</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.argument_label>arrayLiteral</decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type>...</decl.var.parameter>)</decl.function.constructor>",

test/SourceKit/InterfaceGen/gen_stdlib.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
var x: Int
33

4-
// RUN: %sourcekitd-test -req=interface-gen -module Swift -check-interface-ascii > %t.response
4+
// RUN: %sourcekitd-test -req=interface-gen -module Swift > %t.response
55
// RUN: FileCheck -check-prefix=CHECK-STDLIB -input-file %t.response %s
66
// RUN: FileCheck -check-prefix=CHECK-MUTATING-ATTR -input-file %t.response %s
77
// RUN: FileCheck -check-prefix=CHECK-HIDE-ATTR -input-file %t.response %s

0 commit comments

Comments
 (0)