This commit is contained in:
parent
046a393313
commit
b3b33f85f5
13 changed files with 13 additions and 13 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -4,4 +4,4 @@
|
||||||
!*.go
|
!*.go
|
||||||
!*.md
|
!*.md
|
||||||
!*.mod
|
!*.mod
|
||||||
!*.sum
|
!*.sum
|
|
@ -83,4 +83,4 @@ func contains(container any, element any) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
|
@ -36,4 +36,4 @@ func TestFailContains(t *testing.T) {
|
||||||
|
|
||||||
func TestFailNotContains(t *testing.T) {
|
func TestFailNotContains(t *testing.T) {
|
||||||
assert.NotContains(fail(t), "Hello", "H")
|
assert.NotContains(fail(t), "Hello", "H")
|
||||||
}
|
}
|
2
Equal.go
2
Equal.go
|
@ -32,4 +32,4 @@ func DeepEqual[T any](t test, a T, b T) {
|
||||||
|
|
||||||
t.Errorf(twoParameters, file(), "DeepEqual", a, b)
|
t.Errorf(twoParameters, file(), "DeepEqual", a, b)
|
||||||
t.FailNow()
|
t.FailNow()
|
||||||
}
|
}
|
|
@ -39,4 +39,4 @@ func TestFailNotEqual(t *testing.T) {
|
||||||
|
|
||||||
func TestFailDeepEqual(t *testing.T) {
|
func TestFailDeepEqual(t *testing.T) {
|
||||||
assert.DeepEqual(fail(t), "Hello", "World")
|
assert.DeepEqual(fail(t), "Hello", "World")
|
||||||
}
|
}
|
2
Nil.go
2
Nil.go
|
@ -38,4 +38,4 @@ func isNil(object any) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
|
@ -42,4 +42,4 @@ func TestFailNil(t *testing.T) {
|
||||||
|
|
||||||
func TestFailNotNil(t *testing.T) {
|
func TestFailNotNil(t *testing.T) {
|
||||||
assert.NotNil(fail(t), nil)
|
assert.NotNil(fail(t), nil)
|
||||||
}
|
}
|
2
True.go
2
True.go
|
@ -8,4 +8,4 @@ func True(t test, a bool) {
|
||||||
// False asserts that the given parameter is false.
|
// False asserts that the given parameter is false.
|
||||||
func False(t test, a bool) {
|
func False(t test, a bool) {
|
||||||
Equal(t, a, false)
|
Equal(t, a, false)
|
||||||
}
|
}
|
|
@ -9,4 +9,4 @@ import (
|
||||||
func TestTrue(t *testing.T) {
|
func TestTrue(t *testing.T) {
|
||||||
assert.True(t, true)
|
assert.True(t, true)
|
||||||
assert.False(t, false)
|
assert.False(t, false)
|
||||||
}
|
}
|
|
@ -36,4 +36,4 @@ func file() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
return name
|
return name
|
||||||
}
|
}
|
|
@ -16,4 +16,4 @@ func (t *noop) FailNow() {}
|
||||||
// fail creates a new test that is expected to fail.
|
// fail creates a new test that is expected to fail.
|
||||||
func fail(t *testing.T) *noop {
|
func fail(t *testing.T) *noop {
|
||||||
return &noop{}
|
return &noop{}
|
||||||
}
|
}
|
2
go.mod
2
go.mod
|
@ -1,3 +1,3 @@
|
||||||
module git.urbach.dev/go/assert
|
module git.urbach.dev/go/assert
|
||||||
|
|
||||||
go 1.24
|
go 1.24
|
2
test.go
2
test.go
|
@ -4,4 +4,4 @@ package assert
|
||||||
type test interface {
|
type test interface {
|
||||||
Errorf(format string, args ...any)
|
Errorf(format string, args ...any)
|
||||||
FailNow()
|
FailNow()
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue