Skip to content

Commit c259462

Browse files
committed
tweak tests
1 parent d2366c7 commit c259462

14 files changed

+158
-188
lines changed

tests/baselines/reference/staticPropertyAssignmentInherited1.errors.txt

Lines changed: 0 additions & 39 deletions
This file was deleted.

tests/baselines/reference/staticPropertyAssignmentInherited1.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//// [tests/cases/conformance/salsa/staticPropertyAssignmentInherited1.ts] ////
22

33
//// [staticPropertyAssignmentInherited1.js]
4-
let v = Math.random() ? '' : 0;
4+
let v = Math.random() ? '' : Math.random() ? 0 : undefined;
55

66
class Base {
77
static value1 = v;
@@ -34,11 +34,11 @@ function test(cls) {
3434
//// [staticPropertyAssignmentInherited1.d.ts]
3535
/** @param {typeof Derived} cls */
3636
declare function test(cls: typeof Derived): void;
37-
declare let v: string | number;
37+
declare let v: string | number | undefined;
3838
declare class Base {
39-
static value1: string | number;
40-
static value2: string | number;
41-
static value3: string | number;
39+
static value1: string | number | undefined;
40+
static value2: string | number | undefined;
41+
static value3: string | number | undefined;
4242
}
4343
declare class Derived extends Base {
4444
}

tests/baselines/reference/staticPropertyAssignmentInherited1.symbols

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
//// [tests/cases/conformance/salsa/staticPropertyAssignmentInherited1.ts] ////
22

33
=== staticPropertyAssignmentInherited1.js ===
4-
let v = Math.random() ? '' : 0;
4+
let v = Math.random() ? '' : Math.random() ? 0 : undefined;
55
>v : Symbol(v, Decl(staticPropertyAssignmentInherited1.js, 0, 3))
66
>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --))
77
>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
88
>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --))
9+
>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --))
10+
>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
11+
>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --))
12+
>undefined : Symbol(undefined)
913

1014
class Base {
11-
>Base : Symbol(Base, Decl(staticPropertyAssignmentInherited1.js, 0, 31))
15+
>Base : Symbol(Base, Decl(staticPropertyAssignmentInherited1.js, 0, 59))
1216

1317
static value1 = v;
1418
>value1 : Symbol(Base.value1, Decl(staticPropertyAssignmentInherited1.js, 2, 12))
@@ -25,7 +29,7 @@ class Base {
2529

2630
class Derived extends Base {
2731
>Derived : Symbol(Derived, Decl(staticPropertyAssignmentInherited1.js, 6, 1))
28-
>Base : Symbol(Base, Decl(staticPropertyAssignmentInherited1.js, 0, 31))
32+
>Base : Symbol(Base, Decl(staticPropertyAssignmentInherited1.js, 0, 59))
2933

3034
static {
3135
this.value1 = 10;

tests/baselines/reference/staticPropertyAssignmentInherited1.types

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//// [tests/cases/conformance/salsa/staticPropertyAssignmentInherited1.ts] ////
22

33
=== staticPropertyAssignmentInherited1.js ===
4-
let v = Math.random() ? '' : 0;
5-
>v : string | number
6-
> : ^^^^^^^^^^^^^^^
7-
>Math.random() ? '' : 0 : "" | 0
8-
> : ^^^^^^
4+
let v = Math.random() ? '' : Math.random() ? 0 : undefined;
5+
>v : string | number | undefined
6+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
7+
>Math.random() ? '' : Math.random() ? 0 : undefined : "" | 0 | undefined
8+
> : ^^^^^^^^^^^^^^^^^^
99
>Math.random() : number
1010
> : ^^^^^^
1111
>Math.random : () => number
@@ -16,30 +16,42 @@ let v = Math.random() ? '' : 0;
1616
> : ^^^^^^
1717
>'' : ""
1818
> : ^^
19+
>Math.random() ? 0 : undefined : 0 | undefined
20+
> : ^^^^^^^^^^^^^
21+
>Math.random() : number
22+
> : ^^^^^^
23+
>Math.random : () => number
24+
> : ^^^^^^
25+
>Math : Math
26+
> : ^^^^
27+
>random : () => number
28+
> : ^^^^^^
1929
>0 : 0
2030
> : ^
31+
>undefined : undefined
32+
> : ^^^^^^^^^
2133

2234
class Base {
2335
>Base : Base
2436
> : ^^^^
2537

2638
static value1 = v;
27-
>value1 : string | number
28-
> : ^^^^^^^^^^^^^^^
29-
>v : string | number
30-
> : ^^^^^^^^^^^^^^^
39+
>value1 : string | number | undefined
40+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
41+
>v : string | number | undefined
42+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
3143

3244
static value2 = v;
33-
>value2 : string | number
34-
> : ^^^^^^^^^^^^^^^
35-
>v : string | number
36-
> : ^^^^^^^^^^^^^^^
45+
>value2 : string | number | undefined
46+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
47+
>v : string | number | undefined
48+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
3749

3850
static value3 = v;
39-
>value3 : string | number
40-
> : ^^^^^^^^^^^^^^^
41-
>v : string | number
42-
> : ^^^^^^^^^^^^^^^
51+
>value3 : string | number | undefined
52+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
53+
>v : string | number | undefined
54+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
4355
}
4456

4557
class Derived extends Base {
@@ -106,12 +118,12 @@ class Derived extends Base {
106118
> : ^^^^^^
107119
>this.value3 = 30 : 30
108120
> : ^^
109-
>this.value3 : string | number
110-
> : ^^^^^^^^^^^^^^^
121+
>this.value3 : string | number | undefined
122+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
111123
>this : typeof Derived
112124
> : ^^^^^^^^^^^^^^
113-
>value3 : string | number
114-
> : ^^^^^^^^^^^^^^^
125+
>value3 : string | number | undefined
126+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
115127
>30 : 30
116128
> : ^^
117129
>'' : ""
@@ -144,11 +156,11 @@ function test(cls) {
144156
> : ^^^^^^^^^^^^^^^^^^
145157

146158
cls.value3;
147-
>cls.value3 : string | number
148-
> : ^^^^^^^^^^^^^^^
159+
>cls.value3 : string | number | undefined
160+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
149161
>cls : typeof Derived
150162
> : ^^^^^^^^^^^^^^
151-
>value3 : string | number
152-
> : ^^^^^^^^^^^^^^^
163+
>value3 : string | number | undefined
164+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
153165
}
154166

tests/baselines/reference/staticPropertyAssignmentInherited2.errors.txt

Lines changed: 0 additions & 39 deletions
This file was deleted.

tests/baselines/reference/staticPropertyAssignmentInherited2.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//// [tests/cases/conformance/salsa/staticPropertyAssignmentInherited2.ts] ////
22

33
//// [staticPropertyAssignmentInherited2.js]
4-
let v = Math.random() ? '' : 0;
4+
let v = Math.random() ? '' : Math.random() ? 0 : undefined;
55

66
class Base {
77
static value1 = v;
@@ -34,11 +34,11 @@ function test(cls) {
3434
//// [staticPropertyAssignmentInherited2.d.ts]
3535
/** @param {typeof Derived} cls */
3636
declare function test(cls: typeof Derived): void;
37-
declare let v: string | number;
37+
declare let v: string | number | undefined;
3838
declare class Base {
39-
static value1: string | number;
40-
static value2: string | number;
41-
static value3: string | number;
39+
static value1: string | number | undefined;
40+
static value2: string | number | undefined;
41+
static value3: string | number | undefined;
4242
}
4343
declare class Derived extends Base {
4444
}

tests/baselines/reference/staticPropertyAssignmentInherited2.symbols

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
//// [tests/cases/conformance/salsa/staticPropertyAssignmentInherited2.ts] ////
22

33
=== staticPropertyAssignmentInherited2.js ===
4-
let v = Math.random() ? '' : 0;
4+
let v = Math.random() ? '' : Math.random() ? 0 : undefined;
55
>v : Symbol(v, Decl(staticPropertyAssignmentInherited2.js, 0, 3))
66
>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --))
77
>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
88
>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --))
9+
>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --))
10+
>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
11+
>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --))
12+
>undefined : Symbol(undefined)
913

1014
class Base {
11-
>Base : Symbol(Base, Decl(staticPropertyAssignmentInherited2.js, 0, 31))
15+
>Base : Symbol(Base, Decl(staticPropertyAssignmentInherited2.js, 0, 59))
1216

1317
static value1 = v;
1418
>value1 : Symbol(Base.value1, Decl(staticPropertyAssignmentInherited2.js, 2, 12))
@@ -25,7 +29,7 @@ class Base {
2529

2630
class Derived extends Base {
2731
>Derived : Symbol(Derived, Decl(staticPropertyAssignmentInherited2.js, 6, 1))
28-
>Base : Symbol(Base, Decl(staticPropertyAssignmentInherited2.js, 0, 31))
32+
>Base : Symbol(Base, Decl(staticPropertyAssignmentInherited2.js, 0, 59))
2933

3034
static {
3135
this.value1 = 10;

0 commit comments

Comments
 (0)