1
- package compiler
1
+ package compiler_test
2
2
3
3
import (
4
4
"path/filepath"
7
7
"testing"
8
8
9
9
"github.com/microsoft/typescript-go/internal/bundled"
10
+ "github.com/microsoft/typescript-go/internal/compiler"
10
11
"github.com/microsoft/typescript-go/internal/core"
11
12
"github.com/microsoft/typescript-go/internal/repo"
12
13
"github.com/microsoft/typescript-go/internal/tsoptions"
@@ -233,14 +234,14 @@ func TestProgram(t *testing.T) {
233
234
234
235
opts := core.CompilerOptions {Target : testCase .target }
235
236
236
- program := NewProgram (ProgramOptions {
237
+ program := compiler . NewProgram (compiler. ProgramOptions {
237
238
Config : & tsoptions.ParsedCommandLine {
238
239
ParsedConfig : & core.ParsedOptions {
239
240
FileNames : []string {"c:/dev/src/index.ts" },
240
241
CompilerOptions : & opts ,
241
242
},
242
243
},
243
- Host : NewCompilerHost ("c:/dev/src" , fs , bundled .LibPath (), nil , func ( msg string ) {} ),
244
+ Host : compiler . NewCompilerHost ("c:/dev/src" , fs , bundled .LibPath (), nil , nil ),
244
245
})
245
246
246
247
actualFiles := []string {}
@@ -270,18 +271,18 @@ func BenchmarkNewProgram(b *testing.B) {
270
271
}
271
272
272
273
opts := core.CompilerOptions {Target : testCase .target }
273
- programOpts := ProgramOptions {
274
+ programOpts := compiler. ProgramOptions {
274
275
Config : & tsoptions.ParsedCommandLine {
275
276
ParsedConfig : & core.ParsedOptions {
276
277
FileNames : []string {"c:/dev/src/index.ts" },
277
278
CompilerOptions : & opts ,
278
279
},
279
280
},
280
- Host : NewCompilerHost ("c:/dev/src" , fs , bundled .LibPath (), nil , func ( msg string ) {} ),
281
+ Host : compiler . NewCompilerHost ("c:/dev/src" , fs , bundled .LibPath (), nil , nil ),
281
282
}
282
283
283
284
for b .Loop () {
284
- NewProgram (programOpts )
285
+ compiler . NewProgram (programOpts )
285
286
}
286
287
})
287
288
}
@@ -294,18 +295,18 @@ func BenchmarkNewProgram(b *testing.B) {
294
295
fs := osvfs .FS ()
295
296
fs = bundled .WrapFS (fs )
296
297
297
- host := NewCompilerHost (rootPath , fs , bundled .LibPath (), nil , func ( msg string ) {} )
298
+ host := compiler . NewCompilerHost (rootPath , fs , bundled .LibPath (), nil , nil )
298
299
299
300
parsed , errors := tsoptions .GetParsedCommandLineOfConfigFile (tspath .CombinePaths (rootPath , "tsconfig.json" ), nil , host , nil )
300
301
assert .Equal (b , len (errors ), 0 , "Expected no errors in parsed command line" )
301
302
302
- opts := ProgramOptions {
303
+ opts := compiler. ProgramOptions {
303
304
Config : parsed ,
304
305
Host : host ,
305
306
}
306
307
307
308
for b .Loop () {
308
- NewProgram (opts )
309
+ compiler . NewProgram (opts )
309
310
}
310
311
})
311
312
}
0 commit comments