]> 127.0.0.1 Git - part/.git/commitdiff
1 v0.28.20240121080746
authorqydysky <qydysky@foxmail.com>
Sun, 21 Jan 2024 08:01:29 +0000 (16:01 +0800)
committerqydysky <qydysky@foxmail.com>
Sun, 21 Jan 2024 08:01:29 +0000 (16:01 +0800)
component/Component_test.go

index 9ca581ff82fd5accba550c5847ba7f4ecffc6f47..39b9c4b1cfc4ee81483553fe4ca7ccb14c92173c 100644 (file)
@@ -141,24 +141,24 @@ import (
 // }
 
 func TestMain(t *testing.T) {
-       c1 := NewComp(func(ctx context.Context, ptr string) error {
+       c1 := NewComp(func(ctx context.Context, ptr string) (any, error) {
                fmt.Println(ptr)
-               return nil
+               return nil, nil
        })
        c1.Run(context.Background(), "1")
 }
 
-func TestMain2(t *testing.T) {
-       c1 := NewComp(func(ctx context.Context, ptr string) error {
-               fmt.Println(ptr)
-               return ErrSelfDel
-       })
-       c2 := NewComp(func(ctx context.Context, ptr string) error {
-               fmt.Println(ptr + "s")
-               return nil
-       })
-       cs1 := NewComps[string]()
-       cs1.Put(c1, c2)
-       cs1.Run(context.Background(), "1")
-       cs1.Start(context.Background(), "1")
-}
+// func TestMain2(t *testing.T) {
+//     c1 := NewComp(func(ctx context.Context, ptr string) (any,error) {
+//             fmt.Println(ptr)
+//             return ErrSelfDel
+//     })
+//     c2 := NewComp(func(ctx context.Context, ptr string) (any,error) {
+//             fmt.Println(ptr + "s")
+//             return nil
+//     })
+//     cs1 := NewComps[string]()
+//     cs1.Put(c1, c2)
+//     cs1.Run(context.Background(), "1")
+//     cs1.Start(context.Background(), "1")
+// }