Skip to content

Commit 7c517d7

Browse files
committed
Rename files
1 parent f8d66fd commit 7c517d7

919 files changed

Lines changed: 28004 additions & 27998 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

internal/execute/tsctests/extract.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ func (test *tscInput) writeTestSourceFile(scenario string, editOps [][]capturedE
107107
if err := os.MkdirAll(outDir, 0o755); err != nil {
108108
panic(fmt.Errorf("tsctests: failed to create %s: %w", outDir, err))
109109
}
110-
outPath := filepath.Join(outDir, funcName+"_test.go")
110+
testFileName := funcName + "_test.go"
111+
testFileName = strings.ToLower(testFileName[:1]) + testFileName[1:]
112+
outPath := filepath.Join(outDir, testFileName)
111113
if existing, err := os.ReadFile(outPath); err == nil && string(existing) == source {
112114
return
113115
}
@@ -134,7 +136,7 @@ func (test *tscInput) renderTestSource(scenario string, funcName string, editOps
134136
b.WriteString(")\n")
135137
b.WriteString("\n")
136138

137-
fmt.Fprintf(&b, "func %s(t *testing.T) {\n", funcName)
139+
fmt.Fprintf(&b, "func Test%s(t *testing.T) {\n", funcName)
138140
b.WriteString("\ttest := &tsctests.TestSpec{\n")
139141
fmt.Fprintf(&b, "\t\tScenario: %s,\n", strconv.Quote(scenario))
140142
fmt.Fprintf(&b, "\t\tSubScenario: %s,\n", strconv.Quote(test.subScenario))
@@ -313,15 +315,19 @@ var (
313315
// appends a short hash suffix when the sanitized result would be ambiguous.
314316
func makeTestFuncName(parts ...string) string {
315317
var b strings.Builder
316-
b.WriteString("Test")
317318
joinedRaw := strings.Join(parts, "/")
318-
for _, p := range parts {
319+
for i, p := range parts {
319320
sanitized := identSanitizer.ReplaceAllString(p, "_")
320321
sanitized = strings.Trim(sanitized, "_")
321322
if sanitized == "" {
322323
continue
323324
}
324-
b.WriteByte('_')
325+
if i != 0 {
326+
b.WriteByte('_')
327+
} else {
328+
sanitized = strings.ToUpper(sanitized[:1]) + sanitized[1:] // Test function must start with uppercase
329+
}
330+
325331
b.WriteString(sanitized)
326332
}
327333

internal/execute/tsctests/tests/Test_tsbuildWatch_configFileErrors_reports_syntax_errors_in_config_file_test.go

Lines changed: 0 additions & 84 deletions
This file was deleted.

internal/execute/tsctests/tests/Test_tsbuildWatch_demo_updates_with_bad_reference_test.go

Lines changed: 0 additions & 120 deletions
This file was deleted.

internal/execute/tsctests/tests/Test_tsbuildWatch_demo_updates_with_circular_reference_test.go

Lines changed: 0 additions & 121 deletions
This file was deleted.

0 commit comments

Comments
 (0)