-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CodeCompletion] Migrate some tests to batch completion test #1 #36714
Conversation
@swift-ci Please smoke test |
cc: @davezarzycki |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most migration are done by a script. Otherwise...
// CHECK: found code completion token
// CHECK-NOT: Begin completions
is rewritten to
// NORESULT: Token
// NORESULT-NOT: Begin completions
Also // NOCRASH: Token
is for tokens previously not FileCheck
ed at all.
let _ = self.child.value.value.#^COMPLEX_CHAIN_1^# | ||
let _ = child.value.value.#^COMPLEX_CHAIN_2^# | ||
// COMPLEX_CHAIN_1: Begin completions, 3 items | ||
// COMPLEX_CHAIN_1-DAG: Keyword[self]/CurrNominal: self[#Container.Struct2#] | ||
// COMPLEX_CHAIN_1-DAG: Decl[InstanceVar]/CurrNominal: prop1[#Int#] | ||
// COMPLEX_CHAIN_1-DAG: Decl[InstanceVar]/CurrNominal: prop2[#Int#] | ||
// COMPLEX_CHAIN_1: End completions | ||
let _ = self.child.value.value.#^COMPLEX_CHAIN_1?check=COMPLEX_CHAIN^# | ||
let _ = child.value.value.#^COMPLEX_CHAIN_2?check=COMPLEX_CHAIN^# | ||
// COMPLEX_CHAIN: Begin completions, 3 items | ||
// COMPLEX_CHAIN-DAG: Keyword[self]/CurrNominal: self[#Struct2#] | ||
// COMPLEX_CHAIN-DAG: Decl[InstanceVar]/CurrNominal: prop1[#Int#] | ||
// COMPLEX_CHAIN-DAG: Decl[InstanceVar]/CurrNominal: prop2[#Int#] | ||
// COMPLEX_CHAIN: End completions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was no check for COMPLEX_CHAIN_1
and COMPLEX_CHAIN_2
// SKIP_DUPLICATES_PROPERTY: Decl[InstanceVar]/CurrNominal/IsSystem: count[#Int#]{{; name=.+$}} | ||
// SKIP_DUPLICATES_PROPERTY-NOT: count[#Int#] | ||
// SKIP_DUPLICATES_METHOD: Decl[InstanceMethod]/Super/IsSystem: formIndex({#(i): &Int#}, {#offsetBy: Int#})[#Void#]{{; name=.+$}} | ||
// SKIP_DUPLICATES_METHOD-NOT: formIndex({#(i): &Int#}, {#offsetBy: Int#})[#Void#] | ||
// SKIP_DUPLICATES-NOT: count[#Int#] | ||
// SKIP_DUPLICATES-NOT: formIndex({#(i): &Int#}, {#offsetBy: Int#})[#Void#] | ||
// SKIP_DUPLICATES: Decl[InstanceVar]/CurrNominal/IsSystem: count[#Int#]{{; name=.+$}} | ||
// SKIP_DUPLICATES: Decl[InstanceMethod]/Super/IsSystem: formIndex({#(i): &Int#}, {#offsetBy: Int#})[#Void#]{{; name=.+$}} | ||
// SKIP_DUPLICATES-NOT: count[#Int#] | ||
// SKIP_DUPLICATES-NOT: formIndex({#(i): &Int#}, {#offsetBy: Int#})[#Void#] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously
// RUN: %swift-ide-test -code-completion -source-filename %s -code-completion-token=SKIP_DUPLICATES > %t
// RUN: %FileCheck %s --input-file %t --check-prefixes=SKIP_DUPLICATES,SKIP_DUPLICATES_PROPERTY
// RUN: %FileCheck %s --input-file %t --check-prefixes=SKIP_DUPLICATES,SKIP_DUPLICATES_METHOD
We can do this by #^SKIP_DUPLICATES?check=SKIP_DUPLICATES,SKIP_DUPLICATES_PROPERTY;check=SKIP_DUPLICATES,SKIP_DUPLICATES_METHOD^#
But it's not worth it.
@@ -1198,7 +994,7 @@ func testChainedCalls2() { | |||
|
|||
func testChainedCalls3() { | |||
// doBaz() takes a Double. Check that we can recover. | |||
SomeBuilder(42).doFoo().doBaz(SomeBuilder(24))#^CHAINED_CALLS_3^# | |||
SomeBuilder(42).doFoo().doBaz(SomeBuilder(24))#^CHAINED_CALLS_3?xfail=FIXME^# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unfortunate. Previously
// Disabled because we aren't handling failures well.
// FIXME: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CHAINED_CALLS_3 | %FileCheck %s -check-prefix=CHAINED_CALLS_3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better as an fail now though :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, sorry, I have been meaning to do these... just keep doing other things instead.
On my machine, this PR causes the IDE tests to drop out of the top 10 slowest tests for |
Windows failures are unrelated and this PR is test only changes. Merging. |
Before:
After: