2024-10-16 17:24:50 +08:00
|
|
|
package application
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
2025-04-18 22:07:37 +08:00
|
|
|
"mayfly-go/internal/pkg/utils"
|
2024-10-28 12:13:41 +08:00
|
|
|
"strings"
|
2024-10-16 17:24:50 +08:00
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestParseRedisCommand(t *testing.T) {
|
2025-06-22 10:52:06 +08:00
|
|
|
utils.SplitStmts(strings.NewReader("del 'key l3'; set key2 key3; set 'key3' 'value3 and value4'; hset field1 key1 'hvalue2 hvalue3'"), ';', func(stmt string) error {
|
2024-10-28 12:13:41 +08:00
|
|
|
res := parseRedisCommand(stmt)
|
|
|
|
|
fmt.Println(res)
|
|
|
|
|
return nil
|
|
|
|
|
})
|
|
|
|
|
|
2024-10-16 17:24:50 +08:00
|
|
|
}
|