Make unused golden files into an error

This commit is contained in:
David Dworken 2023-12-28 19:33:58 -08:00
parent d8eb079e5f
commit cae6113abc
No known key found for this signature in database

View File

@ -30,8 +30,8 @@ var UNUSED_GOLDENS []string = []string{"TestTui-Exit", "testControlR-ControlC-ba
"TestTui-DefaultColorScheme"}
func main() {
checkGoldensUsed()
exportMetrics()
checkGoldensUsed()
}
func checkGoldensUsed() {
@ -66,7 +66,7 @@ func checkGoldensUsed() {
if !slices.Contains(usedGoldens, goldenName) && !slices.Contains(UNUSED_GOLDENS, goldenName) {
err = fmt.Errorf("golden file %v was never used", goldenName)
fmt.Println(err)
// TODO: Add a panic(err) here too
log.Fatalf("%v", err)
}
}
fmt.Println("Validated that all goldens in testdata/ were referenced!")