diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-04-19 11:21:50 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-04-19 11:21:50 +0200 |
commit | faf9fedc3d39cf226a26cbd41e0152359c46968a (patch) | |
tree | c49a2e7795c4476a7e25a09f1a6130f3f8dd41f5 /htesting | |
parent | 11aa893198e1fe79134a0c4857116e987f29a40a (diff) | |
download | hugo-faf9fedc3d39cf226a26cbd41e0152359c46968a.tar.gz hugo-faf9fedc3d39cf226a26cbd41e0152359c46968a.zip |
resources/images: Fix TestColorLuminance on s390x
Diffstat (limited to 'htesting')
-rw-r--r-- | htesting/hqt/checkers.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/htesting/hqt/checkers.go b/htesting/hqt/checkers.go index 7655d6a63..bf2cb9428 100644 --- a/htesting/hqt/checkers.go +++ b/htesting/hqt/checkers.go @@ -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 { |