@@ -5,10 +5,8 @@ import (
5
5
"iter"
6
6
"os"
7
7
"path/filepath"
8
- "strings"
9
8
"testing"
10
9
11
- "github.com/microsoft/typescript-go/internal/ast"
12
10
"github.com/microsoft/typescript-go/internal/core"
13
11
"github.com/microsoft/typescript-go/internal/repo"
14
12
"github.com/microsoft/typescript-go/internal/scanner"
@@ -47,53 +45,6 @@ func BenchmarkParse(b *testing.B) {
47
45
}
48
46
}
49
47
50
- func TestParseTypeScriptRepo (t * testing.T ) {
51
- t .Parallel ()
52
- repo .SkipIfNoTypeScriptSubmodule (t )
53
-
54
- tests := []struct {
55
- name string
56
- ignoreErrors bool
57
- }{
58
- {"src" , false },
59
- {"scripts" , false },
60
- {"Herebyfile.mjs" , false },
61
- {"tests/cases" , true },
62
- }
63
-
64
- for _ , test := range tests {
65
- root := filepath .Join (repo .TypeScriptSubmodulePath , test .name )
66
-
67
- t .Run (test .name , func (t * testing.T ) {
68
- t .Parallel ()
69
-
70
- for f := range allParsableFiles (t , root ) {
71
- t .Run (f .name , func (t * testing.T ) {
72
- t .Parallel ()
73
-
74
- sourceText , err := os .ReadFile (f .path )
75
- assert .NilError (t , err )
76
-
77
- fileName := tspath .GetNormalizedAbsolutePath (f .path , repo .TypeScriptSubmodulePath )
78
- path := tspath .ToPath (f .path , repo .TypeScriptSubmodulePath , osvfs .FS ().UseCaseSensitiveFileNames ())
79
-
80
- var sourceFile * ast.SourceFile
81
-
82
- if strings .HasSuffix (f .name , ".json" ) {
83
- sourceFile = ParseJSONText (fileName , path , string (sourceText ))
84
- } else {
85
- sourceFile = ParseSourceFile (fileName , path , string (sourceText ), core .ScriptTargetESNext , scanner .JSDocParsingModeParseAll )
86
- }
87
-
88
- if ! test .ignoreErrors {
89
- assert .Equal (t , len (sourceFile .Diagnostics ()), 0 )
90
- }
91
- })
92
- }
93
- })
94
- }
95
- }
96
-
97
48
type parsableFile struct {
98
49
path string
99
50
name string
0 commit comments