Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeCheckOutput ¶
NormalizeCheckOutput applies all normalization functions to the output. This is the main function used by golden file tests to ensure consistent, environment-independent output for comparison.
func NormalizeLineEndings ¶
NormalizeLineEndings normalizes line endings to Unix-style (LF). This prevents golden file tests from failing due to Windows CRLF line endings. Example: "line1\r\nline2\r\n" -> "line1\nline2\n"
func NormalizePaths ¶
NormalizePaths converts absolute paths to relative paths in the output. This ensures golden files work across different development environments. Example: /Users/me/dev/ckeletin-go/cmd/root.go -> ./cmd/root.go
func NormalizeTempPaths ¶
NormalizeTempPaths replaces temporary directory paths with placeholders. This prevents golden file tests from failing due to random temp directory names. Supports macOS, Linux, and Windows temp directory patterns.
Examples:
- macOS: /var/folders/.../TestScaffoldInit1234567890/001 -> /tmp/TEMP_DIR/001
- Linux: /tmp/TestScaffoldInit1234567890/001 -> /tmp/TEMP_DIR/001
- Windows: C:\Users\...\AppData\Local\Temp\TestScaffoldInit1234567890\001 -> /tmp/TEMP_DIR/001
func NormalizeTimings ¶
NormalizeTimings replaces timing values (e.g., "1.23s") with a placeholder. This prevents golden file tests from failing due to performance variations. Handles all duration patterns including: "Completed in 12.34s", "took 45.2s", etc. Example: "Completed in 12.34s" -> "Completed in X.XXs"
Types ¶
This section is empty.