mirror of
https://github.com/ddworken/hishtory.git
synced 2025-05-29 06:38:05 +02:00
Make unused golden files into an error
This commit is contained in:
parent
d8eb079e5f
commit
cae6113abc
@ -30,8 +30,8 @@ var UNUSED_GOLDENS []string = []string{"TestTui-Exit", "testControlR-ControlC-ba
|
|||||||
"TestTui-DefaultColorScheme"}
|
"TestTui-DefaultColorScheme"}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
checkGoldensUsed()
|
|
||||||
exportMetrics()
|
exportMetrics()
|
||||||
|
checkGoldensUsed()
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkGoldensUsed() {
|
func checkGoldensUsed() {
|
||||||
@ -66,7 +66,7 @@ func checkGoldensUsed() {
|
|||||||
if !slices.Contains(usedGoldens, goldenName) && !slices.Contains(UNUSED_GOLDENS, goldenName) {
|
if !slices.Contains(usedGoldens, goldenName) && !slices.Contains(UNUSED_GOLDENS, goldenName) {
|
||||||
err = fmt.Errorf("golden file %v was never used", goldenName)
|
err = fmt.Errorf("golden file %v was never used", goldenName)
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
// TODO: Add a panic(err) here too
|
log.Fatalf("%v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Println("Validated that all goldens in testdata/ were referenced!")
|
fmt.Println("Validated that all goldens in testdata/ were referenced!")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user