mirror of
https://github.com/rjNemo/underscore
synced 2026-06-06 02:26:42 +00:00
23 lines
354 B
Go
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)
|
|
}
|
|
}
|