@@ -24,39 +24,3 @@ function Test-Extent {
2424}
2525
2626$extNamespace = [Microsoft.Windows.PowerShell.ScriptAnalyzer.Extensions.Extensions ]
27- Describe " IScriptExtent Translate Extension" {
28- Context " When a delta is given" {
29- It " Should translate the line numbers for valid positive line delta" {
30- $extent = Get-Extent $null 1 1 2 2
31- $translatedExtent = $extNamespace ::Translate($extent , 1 , 0 )
32- Test-Extent $translatedExtent 2 1 3 2
33- }
34-
35- It " Should translate the column numbers for valid positive column delta" {
36- $extent = Get-Extent $null 1 1 2 2
37- $translatedExtent = $extNamespace ::Translate($extent , 0 , 1 )
38- Test-Extent $translatedExtent 1 2 2 3
39- }
40-
41- It " Should translate the line and column numbers for valid positive line/column delta" {
42- $extent = Get-Extent $null 1 1 2 2
43- $translatedExtent = $extNamespace ::Translate($extent , 1 , 1 )
44- Test-Extent $translatedExtent 2 2 3 3
45- }
46-
47- It " Should throw if translated start line number is less than 1" {
48- $extent = Get-Extent $null 1 1 2 2
49- {$extNamespace ::Translate($extent , -1 , 0 )} | Should Throw
50- }
51-
52- It " Should throw if translated start column number is less than 1" {
53- $extent = Get-Extent $null 1 1 2 2
54- {$extNamespace ::Translate($extent , 0 , -2 )} | Should Throw
55- }
56-
57- It " Should throw if translated end column number is less than 1" {
58- $extent = Get-Extent $null 1 1 2 1
59- {$extNamespace ::Translate($extent , 0 , -1 )} | Should Throw
60- }
61- }
62- }
0 commit comments