Skip to content

Commit

Permalink
Add unit test for func BoolEqual
Browse files Browse the repository at this point in the history
Signed-off-by: zouyu <zouy.fnst@cn.fujitsu.com>
  • Loading branch information
Hellcatlk committed Jun 29, 2020
1 parent 7620a6b commit 3706530
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkg/internal/assert/assert_test.go
Expand Up @@ -64,6 +64,26 @@ func TestExpectError(t *testing.T) {
})
}

func TestBoolEqual(t *testing.T) {
t.Parallel()
t.Run("not equal", func(t *testing.T) {
t.Parallel()
var f fakeT
BoolEqual(&f, true, false)
if int(f) == 0 {
t.Fatalf("Expected t.Errorf to be called but it was not")
}
})
t.Run("equal", func(t *testing.T) {
t.Parallel()
var f fakeT
BoolEqual(&f, true, true)
if int(f) != 0 {
t.Fatalf("Expected t.Errorf not to be called but it was")
}
})
}

func TestStringEqual(t *testing.T) {
t.Parallel()
t.Run("not equal", func(t *testing.T) {
Expand Down

0 comments on commit 3706530

Please sign in to comment.