feat: all tests

This commit is contained in:
verse91
2026-05-09 23:18:08 +07:00
parent be3c08171b
commit 17f33ff480
16 changed files with 460 additions and 43 deletions
+6 -6
View File
@@ -14,9 +14,9 @@ func debugLog(format string, a ...interface{}) {
}
}
// tokenize parses the input string into shell-like tokens handling quotes
// example: tokenize("git commit -m \"hello world\"")
func tokenize(s string) []string {
// SplitAliasTokens parses the input string into shell-like tokens handling quotes
// example: SplitAliasTokens("git commit -m \"hello world\"")
func Tokenize(s string) []string {
tokens := []string{}
var current strings.Builder
inQuote := false
@@ -43,8 +43,8 @@ func tokenize(s string) []string {
return tokens
}
// hasPrefix checks if s starts with prefix using case-insensitive matching
func hasPrefix(s, prefix string) bool {
// HasPrefix checks if s starts with prefix using case-insensitive matching
func HasPrefix(s, prefix string) bool {
if len(prefix) > len(s) {
return false
}
@@ -65,5 +65,5 @@ func hasPrefix(s, prefix string) bool {
// CI = case insensitive
func HasPrefixCI(s, prefix string) bool {
return hasPrefix(s, prefix)
return HasPrefix(s, prefix)
}