Skip to content

Commit

Permalink
adjustments to unit tests
Browse files Browse the repository at this point in the history
to test what they're supposed to be testing more specifically
  • Loading branch information
beauxq committed Sep 8, 2024
1 parent 89b533f commit 943dad2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
30 changes: 15 additions & 15 deletions packages/pyright-internal/src/tests/completions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,12 @@ test('include literals in expression completion', async () => {
//// from typing import TypedDict
////
//// class TestType(TypedDict):
//// A: str
//// B: int
//// key_a: str
//// key_b: int
////
//// var: TestType = {}
////
//// var[[|A/*marker*/|]]
//// var[[|key_a/*marker*/|]]
`;

const state = parseAndGetTestState(code).state;
Expand All @@ -386,8 +386,8 @@ test('include literals in expression completion', async () => {
completions: [
{
kind: CompletionItemKind.Constant,
label: "'A'",
textEdit: { range: state.getPositionRange('marker'), newText: "'A'" },
label: "'key_a'",
textEdit: { range: state.getPositionRange('marker'), newText: "'key_a'" },
},
],
},
Expand All @@ -400,10 +400,10 @@ test('include literals in set key', async () => {
//// from typing import TypedDict
////
//// class TestType(TypedDict):
//// A: str
//// B: int
//// key_a: str
//// key_b: int
////
//// var: TestType = { [|A/*marker*/|] }
//// var: TestType = { [|key_a/*marker*/|] }
`;

const state = parseAndGetTestState(code).state;
Expand All @@ -415,8 +415,8 @@ test('include literals in set key', async () => {
completions: [
{
kind: CompletionItemKind.Constant,
label: "'A'",
textEdit: { range: state.getPositionRange('marker'), newText: "'A'" },
label: "'key_a'",
textEdit: { range: state.getPositionRange('marker'), newText: "'key_a'" },
},
],
},
Expand All @@ -429,10 +429,10 @@ test('include literals in dict key', async () => {
//// from typing import TypedDict
////
//// class TestType(TypedDict):
//// A: str
//// B: int
//// key_a: str
//// key_b: int
////
//// var: TestType = { [|A/*marker*/|] : "hello" }
//// var: TestType = { [|key_a/*marker*/|] : "hello" }
`;

const state = parseAndGetTestState(code).state;
Expand All @@ -444,8 +444,8 @@ test('include literals in dict key', async () => {
completions: [
{
kind: CompletionItemKind.Constant,
label: '"A"',
textEdit: { range: state.getPositionRange('marker'), newText: '"A"' },
label: '"key_a"',
textEdit: { range: state.getPositionRange('marker'), newText: '"key_a"' },
},
],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference path="typings/fourslash.d.ts" />

// @filename: test.py
//// Cust[|/*marker1*/|]
//// Custo[|/*marker1*/|]
//// my_v[|/*marker2*/|]

// @filename: __builtins__.pyi
Expand Down

0 comments on commit 943dad2

Please sign in to comment.