Skip to content

Commit 4f89c6b

Browse files
committed
Fixed all variable PrepareRenameHandler Tests
1 parent 531ae40 commit 4f89c6b

File tree

2 files changed

+27
-25
lines changed

2 files changed

+27
-25
lines changed

test/PowerShellEditorServices.Test.Shared/Refactoring/Variables/RefactorVariableTestCases.cs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@ public class RefactorVariableTestCases
55
{
66
public static RenameTestTarget[] TestCases =
77
[
8-
new ("SimpleVariableAssignment.ps1", Line: 1, Column: 1 ),
9-
new ("VariableRedefinition.ps1", Line: 1, Column: 1 ),
10-
new ("VariableNestedScopeFunction.ps1", Line: 1, Column: 1 ),
11-
new ("VariableInLoop.ps1", Line: 1, Column: 1 ),
12-
new ("VariableInPipeline.ps1", Line: 23, Column: 2 ),
13-
new ("VariableInScriptblockScoped.ps1", Line: 36, Column: 3 ),
14-
new ("VariablewWithinHastableExpression.ps1", Line: 46, Column: 3 ),
15-
new ("VariableNestedFunctionScriptblock.ps1", Line: 20, Column: 4 ),
16-
new ("VariableWithinCommandAstScriptBlock.ps1", Line: 75, Column: 3 ),
17-
new ("VariableWithinForeachObject.ps1", Line: 1, Column: 2 ),
18-
new ("VariableusedInWhileLoop.ps1", Line: 5, Column: 2 ),
19-
new ("VariableInParam.ps1", Line: 16, Column: 24 ),
20-
new ("VariableCommandParameter.ps1", Line: 9, Column: 10 ),
21-
new ("VariableCommandParameter.ps1", Line: 17, Column: 3 ),
22-
new ("VariableScriptWithParamBlock.ps1", Line: 30, Column: 1 ),
23-
new ("VariableNonParam.ps1", Line: 1, Column: 7 ),
24-
new ("VariableParameterCommandWithSameName.ps1", Line: 13, Column: 9 ),
25-
new ("VariableCommandParameterSplatted.ps1", Line: 10, Column: 21 ),
26-
new ("VariableCommandParameterSplatted.ps1", Line: 5, Column: 16 ),
27-
new ("VariableInForeachDuplicateAssignment.ps1", Line: 18, Column: 6 ),
28-
new ("VariableInForloopDuplicateAssignment.ps1", Line: 14, Column: 9 ),
29-
new ("VariableNestedScopeFunctionRefactorInner.ps1", Line: 5, Column: 3 ),
30-
new ("VariableSimpleFunctionParameter.ps1", Line: 9, Column: 6 ),
31-
new ("VariableDotNotationFromInnerFunction.ps1", Line: 26, Column: 11 ),
32-
new ("VariableDotNotationFromInnerFunction.ps1", Line: 1, Column: 1 )
8+
new ("SimpleVariableAssignment.ps1", Line: 1, Column: 1),
9+
new ("VariableCommandParameter.ps1", Line: 3, Column: 17),
10+
new ("VariableCommandParameter.ps1", Line: 10, Column: 9),
11+
new ("VariableCommandParameterSplatted.ps1", Line: 19, Column: 10),
12+
new ("VariableCommandParameterSplatted.ps1", Line: 8, Column: 6),
13+
new ("VariableDotNotationFromInnerFunction.ps1", Line: 1, Column: 1),
14+
new ("VariableDotNotationFromInnerFunction.ps1", Line: 11, Column: 26),
15+
new ("VariableInForeachDuplicateAssignment.ps1", Line: 6, Column: 18),
16+
new ("VariableInForloopDuplicateAssignment.ps1", Line: 9, Column: 14),
17+
new ("VariableInLoop.ps1", Line: 1, Column: 1),
18+
new ("VariableInParam.ps1", Line: 24, Column: 16),
19+
new ("VariableInPipeline.ps1", Line: 2, Column: 23),
20+
new ("VariableInScriptblockScoped.ps1", Line: 2, Column: 16),
21+
new ("VariableNestedFunctionScriptblock.ps1", Line: 4, Column: 20),
22+
new ("VariableNestedScopeFunction.ps1", Line: 1, Column: 1),
23+
new ("VariableNestedScopeFunctionRefactorInner.ps1", Line: 3, Column: 5),
24+
new ("VariableNonParam.ps1", Line: 7, Column: 1),
25+
new ("VariableParameterCommandWithSameName.ps1", Line: 9, Column: 13),
26+
new ("VariableRedefinition.ps1", Line: 1, Column: 1),
27+
new ("VariableScriptWithParamBlock.ps1", Line: 1, Column: 30),
28+
new ("VariableSimpleFunctionParameter.ps1", Line: 6, Column: 9),
29+
new ("VariableusedInWhileLoop.ps1", Line: 2, Column: 5),
30+
new ("VariableWithinCommandAstScriptBlock.ps1", Line: 3, Column: 75),
31+
new ("VariableWithinForeachObject.ps1", Line: 2, Column: 1),
32+
new ("VariablewWithinHastableExpression.ps1", Line: 3, Column: 46),
3333
];
3434
}

test/PowerShellEditorServices.Test/Refactoring/PrepareRenameHandlerTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ public async Task FindsVariable(RenameTestTarget s)
8282
Assert.NotNull(result);
8383
Assert.True(result?.DefaultBehavior?.DefaultBehavior);
8484
}
85+
86+
// TODO: Bad Path Tests (strings, parameters, etc.)
8587
}
8688

8789
public static partial class RenameTestTargetExtensions

0 commit comments

Comments
 (0)