opencontainers / go-digest

Common digest package used across the container ecosystem
https://www.opencontainers.org/
Other
184 stars 60 forks source link

assorted (test) cleanups #88

Closed thaJeztah closed 11 months ago

thaJeztah commented 11 months ago

Some changes I had locally (got some more, but in a follow-up) :smile:

move digest tests to root

These tests have to be in their own package to prevent a circular import between testdigest and the main module, but Go allows for blackbox-testing by using a "_test" package.

This patch:

TestFroms: fix some linting issues

Keep the linters happy:

TestFroms: use sub-tests

Use sub-tests to not fail early if an algorithm fails.

With this change:

=== RUN   TestFroms
=== RUN   TestFroms/sha256
=== RUN   TestFroms/sha384
=== RUN   TestFroms/sha512
--- PASS: TestFroms (0.02s)
    --- PASS: TestFroms/sha256 (0.01s)
    --- PASS: TestFroms/sha384 (0.00s)
    --- PASS: TestFroms/sha512 (0.00s)
PASS

gofmt, and touch-up some godoc