From 1b9f3b0afbe65b8a7a15b9148dd0c7d669ff0991 Mon Sep 17 00:00:00 2001 From: Aleksey Mikhaylov Date: Wed, 27 Sep 2023 01:27:47 +0300 Subject: [PATCH] add test --- funcs/embed/any_test.go | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/funcs/embed/any_test.go b/funcs/embed/any_test.go index cd25bd2..11ea9f4 100644 --- a/funcs/embed/any_test.go +++ b/funcs/embed/any_test.go @@ -1,6 +1,7 @@ package embed_test import ( + strconv2 "strconv" "testing" "github.com/stretchr/testify/require" @@ -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)) + }) + } }) }