resources/images: Fix TestColorLuminance on s390x

This commit is contained in:
Bjørn Erik Pedersen
2024-04-19 11:21:50 +02:00
parent 11aa893198
commit faf9fedc3d
2 changed files with 11 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ package hqt
import (
"errors"
"fmt"
"math"
"reflect"
"strings"
@@ -38,6 +39,11 @@ var IsSameType qt.Checker = &typeChecker{
argNames: []string{"got", "want"},
}
// IsSameFloat64 asserts that two float64 values are equal within a small delta.
var IsSameFloat64 = qt.CmpEquals(cmp.Comparer(func(a, b float64) bool {
return math.Abs(a-b) < 0.0001
}))
type argNames []string
func (a argNames) ArgNames() []string {