From e4c88eeae10f254b87ae6fec7686955e3636166e Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 6 Nov 2014 15:49:59 -0800 Subject: [PATCH] Breakpoint validation for Let and cost --- .../baselines/reference/bpSpan_const.baseline | 176 ++++++++++++++++++ tests/baselines/reference/bpSpan_let.baseline | 94 ++++++++++ .../fourslash/breakpointValidationConst.ts | 25 +++ .../fourslash/breakpointValidationLet.ts | 17 ++ 4 files changed, 312 insertions(+) create mode 100644 tests/baselines/reference/bpSpan_const.baseline create mode 100644 tests/baselines/reference/bpSpan_let.baseline create mode 100644 tests/cases/fourslash/breakpointValidationConst.ts create mode 100644 tests/cases/fourslash/breakpointValidationLet.ts diff --git a/tests/baselines/reference/bpSpan_const.baseline b/tests/baselines/reference/bpSpan_const.baseline new file mode 100644 index 00000000000..bee7d930955 --- /dev/null +++ b/tests/baselines/reference/bpSpan_const.baseline @@ -0,0 +1,176 @@ + +1 >const c1 = false; + + ~~~~~~~~~~~~~~~~~~ => Pos: (0 to 17) SpanInfo: {"start":0,"length":16} + >const c1 = false + >:=> (line 1, col 0) to (line 1, col 16) +-------------------------------- +2 >const c2: number = 23; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (18 to 40) SpanInfo: {"start":18,"length":21} + >const c2: number = 23 + >:=> (line 2, col 0) to (line 2, col 21) +-------------------------------- +3 >const c3 = 0, c4 :string = "", c5 = null; + + ~~~~~~~~~~~~~ => Pos: (41 to 53) SpanInfo: {"start":41,"length":12} + >const c3 = 0 + >:=> (line 3, col 0) to (line 3, col 12) +3 >const c3 = 0, c4 :string = "", c5 = null; + + ~~~~~~~~~~~~~~~~~ => Pos: (54 to 70) SpanInfo: {"start":55,"length":15} + >c4 :string = "" + >:=> (line 3, col 14) to (line 3, col 29) +3 >const c3 = 0, c4 :string = "", c5 = null; + + ~~~~~~~~~~~~ => Pos: (71 to 82) SpanInfo: {"start":72,"length":9} + >c5 = null + >:=> (line 3, col 31) to (line 3, col 40) +-------------------------------- +4 >for(const c4 = 0; c4 < 9; ) { break; } + + ~~~~~~~~~~~~~~~~~ => Pos: (83 to 99) SpanInfo: {"start":87,"length":12} + >const c4 = 0 + >:=> (line 4, col 4) to (line 4, col 16) +4 >for(const c4 = 0; c4 < 9; ) { break; } + + ~~~~~~~~~~~~ => Pos: (100 to 111) SpanInfo: {"start":101,"length":6} + >c4 < 9 + >:=> (line 4, col 18) to (line 4, col 24) +4 >for(const c4 = 0; c4 < 9; ) { break; } + + ~~~~~~~~~~ => Pos: (112 to 121) SpanInfo: {"start":113,"length":5} + >break + >:=> (line 4, col 30) to (line 4, col 35) +-------------------------------- +5 >for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } + + ~~~~~~~~~~~~~~~~~ => Pos: (122 to 138) SpanInfo: {"start":126,"length":12} + >const c5 = 0 + >:=> (line 5, col 4) to (line 5, col 16) +5 >for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } + + ~~~~~~~~ => Pos: (139 to 146) SpanInfo: {"start":140,"length":6} + >c6 = 0 + >:=> (line 5, col 18) to (line 5, col 24) +5 >for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } + + ~~~~~~~~~~~~~ => Pos: (147 to 159) SpanInfo: {"start":148,"length":7} + >c5 < c6 + >:=> (line 5, col 26) to (line 5, col 33) +5 >for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } + + ~~~~~~~~~~=> Pos: (160 to 169) SpanInfo: {"start":161,"length":5} + >break + >:=> (line 5, col 39) to (line 5, col 44) +-------------------------------- +6 >module M { + + ~~~~~~~~~~~ => Pos: (170 to 180) SpanInfo: {"start":170,"length":133} + >module M { + > export const cc1 = false; + > export const cc2: number = 23; + > export const cc3 = 0, cc4 :string = "", cc5 = null; + >} + >:=> (line 6, col 0) to (line 10, col 1) +-------------------------------- +7 > export const cc1 = false; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (181 to 210) SpanInfo: {"start":185,"length":24} + >export const cc1 = false + >:=> (line 7, col 4) to (line 7, col 28) +-------------------------------- +8 > export const cc2: number = 23; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (211 to 245) SpanInfo: {"start":215,"length":29} + >export const cc2: number = 23 + >:=> (line 8, col 4) to (line 8, col 33) +-------------------------------- +9 > export const cc3 = 0, cc4 :string = "", cc5 = null; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (246 to 270) SpanInfo: {"start":250,"length":20} + >export const cc3 = 0 + >:=> (line 9, col 4) to (line 9, col 24) +9 > export const cc3 = 0, cc4 :string = "", cc5 = null; + + ~~~~~~~~~~~~~~~~~~ => Pos: (271 to 288) SpanInfo: {"start":272,"length":16} + >cc4 :string = "" + >:=> (line 9, col 26) to (line 9, col 42) +9 > export const cc3 = 0, cc4 :string = "", cc5 = null; + + ~~~~~~~~~~~~~=> Pos: (289 to 301) SpanInfo: {"start":290,"length":10} + >cc5 = null + >:=> (line 9, col 44) to (line 9, col 54) +-------------------------------- +10 >} + + ~~ => Pos: (302 to 303) SpanInfo: {"start":302,"length":1} + >} + >:=> (line 10, col 0) to (line 10, col 1) +-------------------------------- +11 >const enum E { + + ~~~~~~~~~~~~~~~ => Pos: (304 to 318) SpanInfo: {"start":304,"length":52} + >const enum E { + > A = 1, + > B = 2, + > C = A | B + >} + >:=> (line 11, col 0) to (line 15, col 1) +-------------------------------- +12 > A = 1, + + ~~~~~~~~~~~ => Pos: (319 to 329) SpanInfo: {"start":323,"length":5} + >A = 1 + >:=> (line 12, col 4) to (line 12, col 9) +-------------------------------- +13 > B = 2, + + ~~~~~~~~~~~ => Pos: (330 to 340) SpanInfo: {"start":334,"length":5} + >B = 2 + >:=> (line 13, col 4) to (line 13, col 9) +-------------------------------- +14 > C = A | B + + ~~~~~~~~~~~~~~ => Pos: (341 to 354) SpanInfo: {"start":345,"length":9} + >C = A | B + >:=> (line 14, col 4) to (line 14, col 13) +-------------------------------- +15 >} + + ~~ => Pos: (355 to 356) SpanInfo: {"start":355,"length":1} + >} + >:=> (line 15, col 0) to (line 15, col 1) +-------------------------------- +16 >const enum E2 { + + ~~~~~~~~~~~~~~~~ => Pos: (357 to 372) SpanInfo: {"start":357,"length":41} + >const enum E2 { + > A = 1, + > B, + > C + >} + >:=> (line 16, col 0) to (line 20, col 1) +-------------------------------- +17 > A = 1, + + ~~~~~~~~~~~ => Pos: (373 to 383) SpanInfo: {"start":377,"length":5} + >A = 1 + >:=> (line 17, col 4) to (line 17, col 9) +-------------------------------- +18 > B, + + ~~~~~~~ => Pos: (384 to 390) SpanInfo: {"start":388,"length":1} + >B + >:=> (line 18, col 4) to (line 18, col 5) +-------------------------------- +19 > C + + ~~~~~~ => Pos: (391 to 396) SpanInfo: {"start":395,"length":1} + >C + >:=> (line 19, col 4) to (line 19, col 5) +-------------------------------- +20 >} + ~ => Pos: (397 to 397) SpanInfo: {"start":397,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_let.baseline b/tests/baselines/reference/bpSpan_let.baseline new file mode 100644 index 00000000000..dff12280a96 --- /dev/null +++ b/tests/baselines/reference/bpSpan_let.baseline @@ -0,0 +1,94 @@ + +1 >let l1; + + ~~~~~~~~ => Pos: (0 to 7) SpanInfo: undefined +-------------------------------- +2 >let l2: number; + + ~~~~~~~~~~~~~~~~ => Pos: (8 to 23) SpanInfo: undefined +-------------------------------- +3 >let l3, l4, l5 :string, l6; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (24 to 51) SpanInfo: undefined +-------------------------------- +4 >let l7 = false; + + ~~~~~~~~~~~~~~~~ => Pos: (52 to 67) SpanInfo: {"start":52,"length":14} + >let l7 = false + >:=> (line 4, col 0) to (line 4, col 14) +-------------------------------- +5 >let l8: number = 23; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (68 to 88) SpanInfo: {"start":68,"length":19} + >let l8: number = 23 + >:=> (line 5, col 0) to (line 5, col 19) +-------------------------------- +6 >let l9 = 0, l10 :string = "", l11 = null; + + ~~~~~~~~~~~ => Pos: (89 to 99) SpanInfo: {"start":89,"length":10} + >let l9 = 0 + >:=> (line 6, col 0) to (line 6, col 10) +6 >let l9 = 0, l10 :string = "", l11 = null; + + ~~~~~~~~~~~~~~~~~~ => Pos: (100 to 117) SpanInfo: {"start":101,"length":16} + >l10 :string = "" + >:=> (line 6, col 12) to (line 6, col 28) +6 >let l9 = 0, l10 :string = "", l11 = null; + + ~~~~~~~~~~~~~ => Pos: (118 to 130) SpanInfo: {"start":119,"length":10} + >l11 = null + >:=> (line 6, col 30) to (line 6, col 40) +-------------------------------- +7 >for(let l11 in {}) { } + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (131 to 150) SpanInfo: {"start":131,"length":18} + >for(let l11 in {}) + >:=> (line 7, col 0) to (line 7, col 18) +7 >for(let l11 in {}) { } + + ~~~ => Pos: (151 to 153) SpanInfo: undefined +-------------------------------- +8 >for(let l12 = 0; l12 < 9; l12++) { } + + ~~~~~~~~~~~~~~~~ => Pos: (154 to 169) SpanInfo: {"start":158,"length":11} + >let l12 = 0 + >:=> (line 8, col 4) to (line 8, col 15) +8 >for(let l12 = 0; l12 < 9; l12++) { } + + ~~~~~~~~~ => Pos: (170 to 178) SpanInfo: {"start":171,"length":7} + >l12 < 9 + >:=> (line 8, col 17) to (line 8, col 24) +8 >for(let l12 = 0; l12 < 9; l12++) { } + + ~~~~~~~~~ => Pos: (179 to 187) SpanInfo: {"start":180,"length":5} + >l12++ + >:=> (line 8, col 26) to (line 8, col 31) +8 >for(let l12 = 0; l12 < 9; l12++) { } + + ~~~ => Pos: (188 to 190) SpanInfo: undefined +-------------------------------- +9 >module M { + + ~~~~~~~~~~~ => Pos: (191 to 201) SpanInfo: {"start":191,"length":55} + >module M { + > let ll1 = "s"; + > export let ll2 = 0; + >} + >:=> (line 9, col 0) to (line 12, col 1) +-------------------------------- +10 > let ll1 = "s"; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (202 to 220) SpanInfo: {"start":206,"length":13} + >let ll1 = "s" + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +11 > export let ll2 = 0; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (221 to 244) SpanInfo: {"start":225,"length":18} + >export let ll2 = 0 + >:=> (line 11, col 4) to (line 11, col 22) +-------------------------------- +12 >} + ~ => Pos: (245 to 245) SpanInfo: {"start":245,"length":1} + >} + >:=> (line 12, col 0) to (line 12, col 1) \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationConst.ts b/tests/cases/fourslash/breakpointValidationConst.ts new file mode 100644 index 00000000000..bc3b530a8c2 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationConst.ts @@ -0,0 +1,25 @@ +/// + +// @BaselineFile: bpSpan_const.baseline +// @Filename: bpSpan_const.ts +////const c1 = false; +////const c2: number = 23; +////const c3 = 0, c4 :string = "", c5 = null; +////for(const c4 = 0; c4 < 9; ) { break; } +////for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } +////module M { +//// export const cc1 = false; +//// export const cc2: number = 23; +//// export const cc3 = 0, cc4 :string = "", cc5 = null; +////} +////const enum E { +//// A = 1, +//// B = 2, +//// C = A | B +////} +////const enum E2 { +//// A = 1, +//// B, +//// C +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationLet.ts b/tests/cases/fourslash/breakpointValidationLet.ts new file mode 100644 index 00000000000..cec696850cd --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationLet.ts @@ -0,0 +1,17 @@ +/// + +// @BaselineFile: bpSpan_let.baseline +// @Filename: bpSpan_let.ts +////let l1; +////let l2: number; +////let l3, l4, l5 :string, l6; +////let l7 = false; +////let l8: number = 23; +////let l9 = 0, l10 :string = "", l11 = null; +////for(let l11 in {}) { } +////for(let l12 = 0; l12 < 9; l12++) { } +////module M { +//// let ll1 = "s"; +//// export let ll2 = 0; +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file