underscore/ternary_test.go
2022-06-07 17:54:27 +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)
}
}