diff --git a/cmd/micro/util.go b/cmd/micro/util.go index 8d68dbdc..a91295fe 100644 --- a/cmd/micro/util.go +++ b/cmd/micro/util.go @@ -65,7 +65,7 @@ func Max(a, b int) int { func IsWordChar(str string) bool { if len(str) > 1 { // Unicode - return false + return true } c := str[0] return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c == '_') diff --git a/cmd/micro/util_test.go b/cmd/micro/util_test.go index e3d417d5..c3060ff5 100644 --- a/cmd/micro/util_test.go +++ b/cmd/micro/util_test.go @@ -50,15 +50,15 @@ func TestIsWordChar(t *testing.T) { if IsWordChar("_") == false { t.Errorf("IsWordChar(_) = false") } + if IsWordChar("ß") == false { + t.Errorf("IsWordChar(ß) = false") + } if IsWordChar("~") == true { t.Errorf("IsWordChar(~) = true") } if IsWordChar(" ") == true { t.Errorf("IsWordChar( ) = true") } - if IsWordChar("ß") == true { - t.Errorf("IsWordChar(ß) = true") - } if IsWordChar(")") == true { t.Errorf("IsWordChar()) = true") }