boolean_test.gno
0.71 Kb ยท 37 lines
1package expect_test
2
3import (
4 "testing"
5
6 "gno.land/p/jeronimoalbi/expect"
7)
8
9func TestBooleanChecker(t *testing.T) {
10 t.Run("to be truthy", func(t *testing.T) {
11 t.Parallel()
12
13 ctx := expect.NewContext(t)
14 expect.NewBooleanChecker(ctx, true).ToBeTruthy()
15 })
16
17 t.Run("not to be truthy", func(t *testing.T) {
18 t.Parallel()
19
20 ctx := expect.NewContext(t)
21 expect.NewBooleanChecker(ctx, false).Not().ToBeTruthy()
22 })
23
24 t.Run("to be falsy", func(t *testing.T) {
25 t.Parallel()
26
27 ctx := expect.NewContext(t)
28 expect.NewBooleanChecker(ctx, false).ToBeFalsy()
29 })
30
31 t.Run("not to be falsy", func(t *testing.T) {
32 t.Parallel()
33
34 ctx := expect.NewContext(t)
35 expect.NewBooleanChecker(ctx, true).Not().ToBeFalsy()
36 })
37}