underscore/ternary_test.go
Ruidy 8c2f92f202
ternary op function (#29)
Co-authored-by: Ruidy <rnemausat@newstore.com>
2022-06-08 09:14:03 +02:00

23 lines
354 B
Go

package underscore_test
import (
"testing"
"github.com/stretchr/testify/assert"
u "github.com/rjNemo/underscore"
)
func TestTernary(t *testing.T) {
tests := []struct {
condition bool
want string
}{
{true, "foo"},
{false, "bar"},
}
for _, tc := range tests {
assert.Equal(t, u.Ternary(tc.condition, "foo", "bar"), tc.want)
}
}