vendor tsgo
This commit is contained in:
@@ -0,0 +1,129 @@
|
||||
// Code generated by convertFourslash; DO NOT EDIT.
|
||||
// To modify this test, run "npm run makemanual completionsUnionStringLiteralProperty"
|
||||
|
||||
package fourslash_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/microsoft/typescript-go/internal/fourslash"
|
||||
. "github.com/microsoft/typescript-go/internal/fourslash/tests/util"
|
||||
"github.com/microsoft/typescript-go/internal/testutil"
|
||||
)
|
||||
|
||||
func TestCompletionsUnionStringLiteralProperty(t *testing.T) {
|
||||
fourslash.SkipIfFailing(t)
|
||||
t.Parallel()
|
||||
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
||||
const content = `type Foo = { a: 0, b: 'x' } | { a: 0, b: 'y' } | { a: 1, b: 'z' };
|
||||
const foo: Foo = { a: 0, b: '/*1*/' }
|
||||
|
||||
type Bar = { a: 0, b: 'fx' } | { a: 0, b: 'fy' } | { a: 1, b: 'fz' };
|
||||
const bar: Bar = { a: 0, b: 'f/*2*/' }
|
||||
|
||||
type Baz = { x: 0, y: 0, z: 'a' } | { x: 0, y: 1, z: 'b' } | { x: 1, y: 0, z: 'c' } | { x: 1, y: 1, z: 'd' };
|
||||
const baz1: Baz = { z: '/*3*/' };
|
||||
const baz2: Baz = { x: 0, z: '/*4*/' };
|
||||
const baz3: Baz = { x: 0, y: 1, z: '/*5*/' };
|
||||
const baz4: Baz = { x: 2, y: 1, z: '/*6*/' };`
|
||||
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
||||
defer done()
|
||||
f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
"x",
|
||||
"y",
|
||||
},
|
||||
Excludes: []string{
|
||||
"z",
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "2", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
"fx",
|
||||
"fy",
|
||||
},
|
||||
Excludes: []string{
|
||||
"fz",
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "3", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
"a",
|
||||
"b",
|
||||
"c",
|
||||
"d",
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "4", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
"a",
|
||||
"b",
|
||||
},
|
||||
Excludes: []string{
|
||||
"c",
|
||||
"d",
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "5", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
"b",
|
||||
},
|
||||
Excludes: []string{
|
||||
"a",
|
||||
"c",
|
||||
"d",
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "6", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
"b",
|
||||
"d",
|
||||
},
|
||||
Excludes: []string{
|
||||
"a",
|
||||
"c",
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user