hanayo/vendor/zxq.co/ripple/rippleapi/common/utils_test.go

21 lines
448 B
Go
Raw Normal View History

2019-02-23 13:29:15 +00:00
package common
import "testing"
func TestSafeUsername(t *testing.T) {
tests := []struct {
name string
arg string
want string
}{
{"noChange", "no_change", "no_change"},
{"toLower", "Change_Me", "change_me"},
{"complete", "La_M a m m a_putt na", "la_m_a_m_m_a_putt_na"},
}
for _, tt := range tests {
if got := SafeUsername(tt.arg); got != tt.want {
t.Errorf("%q. SafeUsername() = %v, want %v", tt.name, got, tt.want)
}
}
}