1
0
2025-02-15 13:47:05 -06:00
2025-05-07 09:05:24 -05:00
2025-02-15 16:52:59 -06:00
2025-02-15 13:47:05 -06:00
2025-04-26 15:56:01 -05:00
2025-02-15 16:52:59 -06:00
2025-02-15 16:52:59 -06:00
2025-02-15 16:52:59 -06:00
2025-04-26 15:56:01 -05:00

Assert

Very simple tools for test assertions. Why doesn't Go have assertions built in? Anyone's guess! All credit to Eduard Urbach. The only reason this package exists is to keep a local copy of it for myself, and to handle stylistic differences.

Features

  • Simple API; few brain cells required
  • Tiny codebase; little overhead
  • Zero dependencies; self-contained, built-in Go code. It's predictable!

Installation

go get git.sharkk.net/Go/Assert

Usage

assert.Nil(t, nil)
assert.True(t, true)
assert.Equal(t, "Hello", "Hello")
assert.DeepEqual(t, "Hello", "Hello")
assert.Contains(t, "Hello", "ello")

Tests

PASS: TestContains
PASS: TestNotContains
PASS: TestFailContains
PASS: TestFailNotContains
PASS: TestEqual
PASS: TestNotEqual
PASS: TestDeepEqual
PASS: TestFailEqual
PASS: TestFailNotEqual
PASS: TestFailDeepEqual
PASS: TestNil
PASS: TestNotNil
PASS: TestFailNil
PASS: TestFailNotNil
PASS: TestTrue
coverage: 100.0% of statements
Description
Very simple tools for test assertions.
Readme 33 KiB
2025-05-07 09:05:50 -05:00
Languages
Go 100%