Skip to content

Commit 0dadbfb

Browse files
committed
Fix modified edit baseline
1 parent 6d5d3a8 commit 0dadbfb

File tree

7 files changed

+154
-119
lines changed

7 files changed

+154
-119
lines changed

internal/execute/tsctestrunner_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func (test *tscInput) run(t *testing.T, scenario string) {
5353
for _, do := range test.edits {
5454
do.edit(test.sys)
5555
baselineBuilder.WriteString("\n\nEdit:: " + do.caption + "\n")
56+
test.sys.baselineFSwithDiff(baselineBuilder)
5657

5758
var incrementalProgram *incremental.Program
5859
if watcher == nil {

testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ Signatures::
154154

155155

156156
Edit:: no change
157+
157158
ExitStatus:: 0
158159
Output::
159160
//// [/home/src/workspaces/project/MessageablePerson.d.ts] *modified time*
@@ -176,6 +177,17 @@ Signatures::
176177

177178

178179
Edit:: modify public to protected
180+
//// [/home/src/workspaces/project/MessageablePerson.ts] *modified*
181+
182+
const Messageable = () => {
183+
return class MessageableClass {
184+
protected message = 'hello';
185+
}
186+
};
187+
const wrapper = () => Messageable();
188+
type MessageablePerson = InstanceType<ReturnType<typeof wrapper>>;
189+
export default MessageablePerson;
190+
179191
ExitStatus:: 2
180192
Output::
181193
MessageablePerson.ts:7:31 - error TS4094: Property 'message' of exported anonymous class type may not be private or protected.
@@ -201,16 +213,6 @@ Errors Files
201213

202214
//// [/home/src/workspaces/project/MessageablePerson.d.ts] *modified time*
203215
//// [/home/src/workspaces/project/MessageablePerson.js] *modified time*
204-
//// [/home/src/workspaces/project/MessageablePerson.ts] *modified*
205-
206-
const Messageable = () => {
207-
return class MessageableClass {
208-
protected message = 'hello';
209-
}
210-
};
211-
const wrapper = () => Messageable();
212-
type MessageablePerson = InstanceType<ReturnType<typeof wrapper>>;
213-
export default MessageablePerson;
214216
//// [/home/src/workspaces/project/main.d.ts] *modified time*
215217
//// [/home/src/workspaces/project/main.js] *modified time*
216218
//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
@@ -325,6 +327,7 @@ Signatures::
325327

326328

327329
Edit:: no change
330+
328331
ExitStatus:: 2
329332
Output::
330333
MessageablePerson.ts:7:31 - error TS4094: Property 'message' of exported anonymous class type may not be private or protected.
@@ -465,10 +468,6 @@ Signatures::
465468

466469

467470
Edit:: modify protected to public
468-
ExitStatus:: 0
469-
Output::
470-
//// [/home/src/workspaces/project/MessageablePerson.d.ts] *modified time*
471-
//// [/home/src/workspaces/project/MessageablePerson.js] *modified time*
472471
//// [/home/src/workspaces/project/MessageablePerson.ts] *modified*
473472

474473
const Messageable = () => {
@@ -479,6 +478,11 @@ Output::
479478
const wrapper = () => Messageable();
480479
type MessageablePerson = InstanceType<ReturnType<typeof wrapper>>;
481480
export default MessageablePerson;
481+
482+
ExitStatus:: 0
483+
Output::
484+
//// [/home/src/workspaces/project/MessageablePerson.d.ts] *modified time*
485+
//// [/home/src/workspaces/project/MessageablePerson.js] *modified time*
482486
//// [/home/src/workspaces/project/main.d.ts] *modified time*
483487
//// [/home/src/workspaces/project/main.js] *modified time*
484488
//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
@@ -556,6 +560,7 @@ Signatures::
556560

557561

558562
Edit:: no change
563+
559564
ExitStatus:: 0
560565
Output::
561566
//// [/home/src/workspaces/project/MessageablePerson.d.ts] *modified time*

testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ Signatures::
129129

130130

131131
Edit:: no change
132+
132133
ExitStatus:: 0
133134
Output::
134135
//// [/home/src/workspaces/project/MessageablePerson.js] *modified time*
@@ -208,6 +209,17 @@ Signatures::
208209

209210

210211
Edit:: modify public to protected
212+
//// [/home/src/workspaces/project/MessageablePerson.ts] *modified*
213+
214+
const Messageable = () => {
215+
return class MessageableClass {
216+
protected message = 'hello';
217+
}
218+
};
219+
const wrapper = () => Messageable();
220+
type MessageablePerson = InstanceType<ReturnType<typeof wrapper>>;
221+
export default MessageablePerson;
222+
211223
ExitStatus:: 2
212224
Output::
213225
main.ts:4:49 - error TS2445: Property 'message' is protected and only accessible within class 'MessageableClass' and its subclasses.
@@ -219,16 +231,6 @@ Output::
219231
Found 1 error in main.ts:4
220232

221233
//// [/home/src/workspaces/project/MessageablePerson.js] *modified time*
222-
//// [/home/src/workspaces/project/MessageablePerson.ts] *modified*
223-
224-
const Messageable = () => {
225-
return class MessageableClass {
226-
protected message = 'hello';
227-
}
228-
};
229-
const wrapper = () => Messageable();
230-
type MessageablePerson = InstanceType<ReturnType<typeof wrapper>>;
231-
export default MessageablePerson;
232234
//// [/home/src/workspaces/project/main.js] *modified time*
233235
//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
234236
{"version":"FakeTSVersion","fileNames":["../../tslibs/TS/Lib/lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"575a4e15624573144926595079b1ec30f9c7853bab32f43c0b7db2acfdf038e2","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ab8b2498ae671bdc5aefe51a9de13bf17d8e0438f2f573353d18e104344dd81f","signature":"6ec1f7bdc192ba06258caff3fa202fd577f8f354d676f548500eeb232155cbbe","impliedNodeFormat":1},{"version":"36f0b00de3c707929bf1919e32e5b6053c8730bb00aa779bcdd1925414d68b8c","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"module":99},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":204,"end":211,"code":2445,"category":1,"message":"Property 'message' is protected and only accessible within class 'MessageableClass' and its subclasses."}]]]}
@@ -318,6 +320,7 @@ Signatures::
318320

319321

320322
Edit:: no change
323+
321324
ExitStatus:: 2
322325
Output::
323326
main.ts:4:49 - error TS2445: Property 'message' is protected and only accessible within class 'MessageableClass' and its subclasses.
@@ -419,9 +422,6 @@ Signatures::
419422

420423

421424
Edit:: modify protected to public
422-
ExitStatus:: 0
423-
Output::
424-
//// [/home/src/workspaces/project/MessageablePerson.js] *modified time*
425425
//// [/home/src/workspaces/project/MessageablePerson.ts] *modified*
426426

427427
const Messageable = () => {
@@ -432,6 +432,10 @@ Output::
432432
const wrapper = () => Messageable();
433433
type MessageablePerson = InstanceType<ReturnType<typeof wrapper>>;
434434
export default MessageablePerson;
435+
436+
ExitStatus:: 0
437+
Output::
438+
//// [/home/src/workspaces/project/MessageablePerson.js] *modified time*
435439
//// [/home/src/workspaces/project/main.js] *modified time*
436440
//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
437441
{"version":"FakeTSVersion","fileNames":["../../tslibs/TS/Lib/lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"575a4e15624573144926595079b1ec30f9c7853bab32f43c0b7db2acfdf038e2","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ff666de4fdc53b5500de60a9b8c073c9327a9e9326417ef4861b8d2473c7457a","signature":"0858d1a081aa47feef2a37c5648868c3ecc110cde2469aea716091b9869a58ed","impliedNodeFormat":1},{"version":"36f0b00de3c707929bf1919e32e5b6053c8730bb00aa779bcdd1925414d68b8c","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"module":99},"referencedMap":[[3,1]]}
@@ -507,6 +511,7 @@ Signatures::
507511

508512

509513
Edit:: no change
514+
510515
ExitStatus:: 0
511516
Output::
512517
//// [/home/src/workspaces/project/MessageablePerson.js] *modified time*

testdata/baselines/reference/tscWatch/noEmit/dts-errors-without-dts-enabled.js

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ Signatures::
5050

5151

5252
Edit:: fix syntax error
53-
54-
Output::
5553
//// [/home/src/workspaces/project/a.ts] *modified*
5654
const a = "hello";
5755

5856

57+
Output::
58+
59+
5960
SemanticDiagnostics::
6061
*refresh* /home/src/tslibs/TS/Lib/lib.d.ts
6162
*refresh* /home/src/workspaces/project/a.ts
@@ -65,11 +66,6 @@ Signatures::
6566

6667

6768
Edit:: emit after fixing error
68-
69-
Output::
70-
//// [/home/src/workspaces/project/a.js] *new*
71-
const a = "hello";
72-
7369
//// [/home/src/workspaces/project/tsconfig.json] *modified*
7470
{
7571
"compilerOptions": {
@@ -78,6 +74,12 @@ const a = "hello";
7874
}
7975

8076

77+
Output::
78+
//// [/home/src/workspaces/project/a.js] *new*
79+
const a = "hello";
80+
81+
82+
8183
SemanticDiagnostics::
8284
*refresh* /home/src/tslibs/TS/Lib/lib.d.ts
8385
*refresh* /home/src/workspaces/project/a.ts
@@ -88,8 +90,6 @@ Signatures::
8890

8991

9092
Edit:: no emit run after fixing error
91-
92-
Output::
9393
//// [/home/src/workspaces/project/tsconfig.json] *modified*
9494
{
9595
"compilerOptions": {
@@ -99,6 +99,9 @@ Output::
9999
}
100100

101101

102+
Output::
103+
104+
102105
SemanticDiagnostics::
103106
*refresh* /home/src/tslibs/TS/Lib/lib.d.ts
104107
*refresh* /home/src/workspaces/project/a.ts
@@ -109,12 +112,13 @@ Signatures::
109112

110113

111114
Edit:: introduce error
112-
113-
Output::
114115
//// [/home/src/workspaces/project/a.ts] *modified*
115116
const a = class { private p = 10; };
116117

117118

119+
Output::
120+
121+
118122
SemanticDiagnostics::
119123
*refresh* /home/src/tslibs/TS/Lib/lib.d.ts
120124
*refresh* /home/src/workspaces/project/a.ts
@@ -124,19 +128,20 @@ Signatures::
124128

125129

126130
Edit:: emit when error
131+
//// [/home/src/workspaces/project/tsconfig.json] *modified*
132+
{
133+
"compilerOptions": {
134+
135+
}
136+
}
137+
127138

128139
Output::
129140
//// [/home/src/workspaces/project/a.js] *modified*
130141
const a = class {
131142
p = 10;
132143
};
133144

134-
//// [/home/src/workspaces/project/tsconfig.json] *modified*
135-
{
136-
"compilerOptions": {
137-
138-
}
139-
}
140145

141146

142147
SemanticDiagnostics::
@@ -149,8 +154,6 @@ Signatures::
149154

150155

151156
Edit:: no emit run when error
152-
153-
Output::
154157
//// [/home/src/workspaces/project/tsconfig.json] *modified*
155158
{
156159
"compilerOptions": {
@@ -160,6 +163,9 @@ Output::
160163
}
161164

162165

166+
Output::
167+
168+
163169
SemanticDiagnostics::
164170
*refresh* /home/src/tslibs/TS/Lib/lib.d.ts
165171
*refresh* /home/src/workspaces/project/a.ts

0 commit comments

Comments
 (0)