mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 12:32:08 -06:00
Address PR feedback: use baseline testing to show case/default/thing ordering and verify thing availability
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
This commit is contained in:
parent
c8b6d8ca62
commit
75fcd1d14c
25176
tests/baselines/reference/switchCaseCompletionPriority.baseline
Normal file
25176
tests/baselines/reference/switchCaseCompletionPriority.baseline
Normal file
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,7 @@
|
||||
// @noLib: true
|
||||
|
||||
//// declare const thing: string;
|
||||
//// declare const console: { log(x: any): void; };
|
||||
|
||||
//// // Basic switch block - should prioritize case/default
|
||||
//// switch (thing) {
|
||||
@ -59,68 +60,34 @@
|
||||
//// /*newPrio4*/
|
||||
//// }
|
||||
|
||||
// Scenarios where case/default should be prioritized
|
||||
// Test scenarios that show the relative ordering of case, default, and other completions
|
||||
|
||||
// Basic switch block - should prioritize case/default over other completions
|
||||
goTo.marker("basic");
|
||||
verify.baselineCompletions();
|
||||
// Also verify that 'thing' is still available
|
||||
verify.completions({
|
||||
includes: [
|
||||
{ name: "case", sortText: "10" },
|
||||
{ name: "default", sortText: "10" }
|
||||
{ name: "thing", sortText: "11" }
|
||||
]
|
||||
});
|
||||
|
||||
// After break statement with proper indentation - should prioritize case/default
|
||||
goTo.marker("newPrio1");
|
||||
verify.baselineCompletions();
|
||||
// Also verify that 'thing' is still available
|
||||
verify.completions({
|
||||
includes: [
|
||||
{ name: "case", sortText: "10" },
|
||||
{ name: "default", sortText: "10" }
|
||||
{ name: "thing", sortText: "11" }
|
||||
]
|
||||
});
|
||||
|
||||
goTo.marker("newPrio2");
|
||||
verify.completions({
|
||||
includes: [
|
||||
{ name: "case", sortText: "10" },
|
||||
{ name: "default", sortText: "10" }
|
||||
]
|
||||
});
|
||||
|
||||
goTo.marker("newPrio3");
|
||||
verify.completions({
|
||||
includes: [
|
||||
{ name: "case", sortText: "10" },
|
||||
{ name: "default", sortText: "10" }
|
||||
]
|
||||
});
|
||||
|
||||
goTo.marker("newPrio4");
|
||||
verify.completions({
|
||||
includes: [
|
||||
{ name: "case", sortText: "10" },
|
||||
{ name: "default", sortText: "10" }
|
||||
]
|
||||
});
|
||||
|
||||
// Scenarios where case/default should NOT be prioritized
|
||||
// Should NOT prioritize case/default (normal ordering)
|
||||
goTo.marker("sameAll1");
|
||||
verify.baselineCompletions();
|
||||
// Also verify that 'thing' is still available
|
||||
verify.completions({
|
||||
includes: [
|
||||
{ name: "case", sortText: "15" },
|
||||
{ name: "default", sortText: "15" }
|
||||
]
|
||||
});
|
||||
|
||||
goTo.marker("sameAll2");
|
||||
verify.completions({
|
||||
includes: [
|
||||
{ name: "case", sortText: "15" },
|
||||
{ name: "default", sortText: "15" }
|
||||
]
|
||||
});
|
||||
|
||||
goTo.marker("sameAll3");
|
||||
verify.completions({
|
||||
includes: [
|
||||
{ name: "case", sortText: "15" },
|
||||
{ name: "default", sortText: "15" }
|
||||
{ name: "thing", sortText: "11" }
|
||||
]
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user