mirror of
https://github.com/ddworken/hishtory.git
synced 2025-02-13 00:50:22 +01:00
Make unused goldens check in tests more lenient with goldens that are OS-specific
This commit is contained in:
parent
29adbd2372
commit
db19d8ebf1
@ -63,7 +63,16 @@ func checkGoldensUsed() {
|
|||||||
// And check for mismatches
|
// And check for mismatches
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
goldenName := path.Base(f.Name())
|
goldenName := path.Base(f.Name())
|
||||||
if !slices.Contains(usedGoldens, goldenName) && !slices.Contains(UNUSED_GOLDENS, goldenName) {
|
if !slices.Contains(usedGoldens, goldenName) {
|
||||||
|
if slices.Contains(UNUSED_GOLDENS, goldenName) {
|
||||||
|
// It is allowlisted to not be used
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (runtime.GOOS == "darwin" && strings.Contains(goldenName, "-linux")) ||
|
||||||
|
(runtime.GOOS == "linux" && strings.Contains(goldenName, "-darwin")) {
|
||||||
|
// It is for another OS
|
||||||
|
continue
|
||||||
|
}
|
||||||
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)
|
||||||
log.Fatalf("%v", err)
|
log.Fatalf("%v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user