Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhalytch committed Sep 26, 2023
1 parent 5d1ce15 commit 1b9f3b0
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions funcs/embed/any_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package embed_test

import (
strconv2 "strconv"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -23,12 +24,22 @@ func TestEmbedString(t *testing.T) {
func TestEmbedBool(t *testing.T) {
t.Run("bool", func(t *testing.T) {
type testType bool
testVal := true

emb := testType(testVal)
require.NotEqual(t, testVal, emb)

require.Equal(t, emb, embed.Bool[testType](testVal))
tests := []struct {
v bool
}{
{true},
{false},
}
for i, test := range tests {
t.Run(strconv2.Itoa(i), func(t *testing.T) {
testVal := test.v

emb := testType(testVal)
require.NotEqual(t, testVal, emb)

require.Equal(t, emb, embed.Bool[testType](testVal))
})
}
})
}

Expand Down

0 comments on commit 1b9f3b0

Please sign in to comment.