You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
507 B

package phoneletters_test
import (
"testing"
"git.jxs.me/leetgo/phoneletters"
"github.com/stretchr/testify/require"
)
func TestEm(t *testing.T) {
require.Equal(t, []string{}, phoneletters.Combinations(""))
}
func TestSingle(t *testing.T) {
require.Equal(t, []string{"a", "b", "c"}, phoneletters.Combinations("2"))
}
func TestDoble(t *testing.T) {
expected := []string{
"ad", "ae", "af",
"bd", "be", "bf",
"cd", "ce", "cf",
}
require.Equal(t, expected, phoneletters.Combinations("23"))
}