Move command component

This commit is contained in:
Tnze
2022-01-04 12:23:48 +08:00
parent be3a834696
commit badf77d219
5 changed files with 124 additions and 125 deletions

View File

@ -1,12 +1,13 @@
package command
import (
"context"
"log"
"testing"
)
func TestRoot_Run(t *testing.T) {
handleFunc := func(args []ParsedData) error {
handleFunc := func(ctx context.Context, args []ParsedData) error {
log.Printf("Command: args: %v", args)
return nil
}
@ -25,7 +26,7 @@ func TestRoot_Run(t *testing.T) {
HandleFunc(handleFunc),
)
err := g.Run("me Tnze Xi_Xi_Mi")
err := g.Execute(context.TODO(), "me Tnze Xi_Xi_Mi")
if err != nil {
t.Fatal(err)
}