diff --git a/go.mod b/go.mod index ad3cbb1..616c6c3 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ godebug ( require ( github.com/AlekSi/lazyerrors v0.6.0 + github.com/AlekSi/shoulda v0.0.0-20260512184202-90296728414d github.com/alecthomas/kong v1.15.0 github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b github.com/stretchr/testify v1.11.1 diff --git a/go.sum b/go.sum index 989d45e..b00004a 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/AlekSi/lazyerrors v0.6.0 h1:TX4iCP7N+YOuOmUl6Gv5OQ7brhPzPPrSsEAm+at+avk= github.com/AlekSi/lazyerrors v0.6.0/go.mod h1:TresBdOmCoC169IDo09YbrYUDXiqRwlLpInBeS1qD2g= +github.com/AlekSi/shoulda v0.0.0-20260512184202-90296728414d h1:+1oFTJXeqDo0mKvIgFSbgG1WIz5t5nl14dX0EylSVK0= +github.com/AlekSi/shoulda v0.0.0-20260512184202-90296728414d/go.mod h1:QH+MbmZ0XGLxMGQqQLpWokX+oKxrvJq8QHl9UDwPiHk= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= github.com/alecthomas/kong v1.15.0 h1:BVJstKbpO73zKpmIu+m/aLRrNmWwxXPIGTNin9VmLVI= diff --git a/internal/caches/local/disk_test.go b/internal/caches/local/disk_test.go index 4ea15ff..fa8a9eb 100644 --- a/internal/caches/local/disk_test.go +++ b/internal/caches/local/disk_test.go @@ -4,7 +4,7 @@ import ( "os/exec" "testing" - "github.com/stretchr/testify/assert" + "github.com/AlekSi/shoulda" "github.com/stretchr/testify/require" ) @@ -18,7 +18,7 @@ func TestDiskInfo(t *testing.T) { t.Logf("\n total: %dM, free: %dM", total/1024/1024, free/1024/1024) - assert.Positive(t, total) - assert.Positive(t, free) - assert.Greater(t, total, free) + shoulda.BeGreater(t, total, 0) + shoulda.BeGreater(t, free, 0) + shoulda.BeGreater(t, total, free) } diff --git a/internal/caches/local/local_test.go b/internal/caches/local/local_test.go index 071febf..7d048bf 100644 --- a/internal/caches/local/local_test.go +++ b/internal/caches/local/local_test.go @@ -9,6 +9,7 @@ import ( "testing" "time" + "github.com/AlekSi/shoulda" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -116,8 +117,8 @@ func TestTrimNoop(t *testing.T) { require.NoError(t, err) before, freed := c.TrimForce() - assert.EqualValues(t, -1, before) - assert.EqualValues(t, 0, freed) + shoulda.BeEqual(t, before, -1) + shoulda.BeEqual(t, freed, 0) } func TestTrimCutoffNone(t *testing.T) {