Skip to content
Prev Previous commit
Next Next commit
new benchmarks
  • Loading branch information
jakebailey committed Oct 28, 2024
commit 4dd154b2f97515fc419201528e5f7374a6e1286d
26 changes: 9 additions & 17 deletions internal/compiler/fixtures_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package compiler

import (
"os"

"github.com/microsoft/typescript-go/internal/repo"
"github.com/microsoft/typescript-go/internal/testutil"
)

Expand All @@ -13,18 +12,11 @@ func must[T any](v T, err error) T {
return v
}

var (
// Test binaries always start in the package directory; grab this early.
cwd = must(os.Getwd())

emptyFile = testutil.NewFileFixtureFromString("empty.ts", "empty.ts", "")
checkerTs = testutil.NewFileFixtureFromFile("checker.ts", []string{cwd, "../../_submodules/TypeScript/src/compiler/checker.ts"})
// largeTsxFile = testutil.NewFixture("jsxComplexSignatureHasApplicabilityError.tsx", []string{cwd, "../../_submodules/TypeScript/tests/cases/compiler/jsxComplexSignatureHasApplicabilityError.tsx"})

benchFixtures = []testutil.FileFixture{
emptyFile,
checkerTs,
// This crashes in bind.
// largeTsxFile,
}
)
var benchFixtures = []testutil.FileFixture{
testutil.NewFileFixtureFromString("empty.ts", "empty.ts", ""),
testutil.NewFileFixtureFromFile("checker.ts", []string{repo.TypeScriptSubmodulePath, "src/compiler/checker.ts"}),
testutil.NewFileFixtureFromFile("dom.generated.d.ts", []string{repo.TypeScriptSubmodulePath, "src/lib/dom.generated.d.ts"}),
testutil.NewFileFixtureFromFile("Herebyfile.mjs", []string{repo.TypeScriptSubmodulePath, "Herebyfile.mjs"}),
// This crashes in bind.
// testutil.NewFixture("jsxComplexSignatureHasApplicabilityError.tsx", []string{cwd, "../../_submodules/TypeScript/tests/cases/compiler/jsxComplexSignatureHasApplicabilityError.tsx"}),
}