-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add extra test cases for string literal completions (#54714)
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
tests/cases/fourslash/completionsLiteralDirectlyInArgumentWithNullableConstraint.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/// <reference path="fourslash.ts" /> | ||
// @strict: true | ||
//// | ||
//// declare function func< | ||
//// const T extends 'a' | 'b' | undefined = undefined, | ||
//// >(arg?: T): string; | ||
//// | ||
//// func('/*1*/'); | ||
|
||
verify.completions({ marker: ["1"], exact: [`a`, `b`] }); |
16 changes: 16 additions & 0 deletions
16
tests/cases/fourslash/completionsLiteralDirectlyInRestConstrainedToTupleType.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/// <reference path="fourslash.ts" /> | ||
// @strict: true | ||
//// | ||
//// interface Func { | ||
//// <Key extends "a" | "b">( | ||
//// ...args: | ||
//// | [key: Key, options?: any] | ||
//// | [key: Key, defaultValue: string, options?: any] | ||
//// ): string; | ||
//// } | ||
//// | ||
//// declare const func: Func; | ||
//// | ||
//// func("/*1*/"); | ||
|
||
verify.completions({ marker: ["1"], exact: [`a`, `b`] }); |