Skip to content

Commit cd7a8f6

Browse files
authored
Remove old parser tests (#960)
1 parent 5fddc86 commit cd7a8f6

File tree

1 file changed

+0
-49
lines changed

1 file changed

+0
-49
lines changed

internal/parser/parser_test.go

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ import (
55
"iter"
66
"os"
77
"path/filepath"
8-
"strings"
98
"testing"
109

11-
"github.com/microsoft/typescript-go/internal/ast"
1210
"github.com/microsoft/typescript-go/internal/core"
1311
"github.com/microsoft/typescript-go/internal/repo"
1412
"github.com/microsoft/typescript-go/internal/scanner"
@@ -47,53 +45,6 @@ func BenchmarkParse(b *testing.B) {
4745
}
4846
}
4947

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-
9748
type parsableFile struct {
9849
path string
9950
name string

0 commit comments

Comments
 (0)