Skip to content

rprtr258/assert

Repository files navigation

UNDER DEVELOPMENT REQUIRES HEAVY TESTING

Why

  • generics are used where possible
  • meaningful diffs instead of bunch of lines(that is git-diff(actual, expected)) somewhere from values string representations, tree diffs are used instead, so you can see exactly where values do not match
  • in unequal strings unprintable characters are escaped appropriately
  • less dependencies than stretchr/testify
  • fixtures api: use test resources and have them destroyed automatically:
    • env vars
    • file content
    • parsed json
    • temp file
    • temp dir
    • io.Reader contents
  • power assert
  • no api mirroring for asserting or require-ing and failing immediately after check
  • golden files support
  • pretty and colourful test output
  • no Expect(ACTUAL).To(Equal(EXPECTED)) nonsense rewriting of simple ACTUAL == EXPECTED, just use assert.Equal(t, ACTUAL, EXPECTED) or assert.Assert(t, ACTUAL == EXPECTED) and see values used in case of failure (dark magic inside)

Comparison with other libraries

features rprtr258/assert stretchr/testify shoenig/test alecthomas/assert
minimal dependencies
generics
meaningful diffs
power assert
fixtures 1
no api mirroring
golden files support

Footnotes

  1. temp file and port only