]> 127.0.0.1 Git - part/.git/commitdiff
add v0.28.0+202308152f515ad
authorqydysky <qydysky@foxmail.com>
Tue, 15 Aug 2023 11:36:49 +0000 (19:36 +0800)
committerqydysky <qydysky@foxmail.com>
Tue, 15 Aug 2023 11:36:49 +0000 (19:36 +0800)
component/testdata/comp_test.go
component/testdata/eg/eg.go

index 55eba5f6ad3831453debbd8d976e89252eb275b2..3dd5aaec3d244302b5f3b6c493036a1e0159da61 100644 (file)
@@ -9,7 +9,7 @@ import (
 
 func TestMain(t *testing.T) {
        var s = "s"
-       if e := comp.Run[string](`test`, context.Background(), &s); e != nil {
+       if e := comp.Run[string](`test`, context.Background(), &s); e.Error() != "1" {
                t.Fatal(e)
        }
 }
index d5764df401052cf45526f817b79820f9bb7620fd..6aa1637227f310d2b7060a457aa6642e3aa8b0ca 100644 (file)
@@ -2,6 +2,7 @@ package eg
 
 import (
        "context"
+       "errors"
 
        comp "github.com/qydysky/part/component"
 )
@@ -15,6 +16,8 @@ func init() {
 }
 
 func deal(ctx context.Context, ptr *string) error {
-       println(*ptr)
+       if *ptr == "s" {
+               return errors.New("1")
+       }
        return nil
 }