You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
515 B
Go
18 lines
515 B
Go
4 years ago
|
package generator
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestFormatFilename(t *testing.T) {
|
||
|
assert.Equal(t, "abc", formatFilename("a_b_c", namingLower))
|
||
|
assert.Equal(t, "ABC", formatFilename("a_b_c", namingCamel))
|
||
|
assert.Equal(t, "a_b_c", formatFilename("a_b_c", namingSnake))
|
||
|
assert.Equal(t, "a", formatFilename("a", namingSnake))
|
||
|
assert.Equal(t, "A", formatFilename("a", namingCamel))
|
||
|
// no flag to convert to snake
|
||
|
assert.Equal(t, "abc", formatFilename("abc", namingSnake))
|
||
|
}
|