diff options
author | 2023-08-07 19:38:11 +0200 | |
---|---|---|
committer | 2023-08-07 18:38:11 +0100 | |
commit | be3718f6e4c7bb229f9eb78b44c52d14399977cc (patch) | |
tree | a0efc132fbfb806227cc4b9af8bac9f5a5775c1c /internal/processing/fromclientapi_test.go | |
parent | [chore]: Bump github.com/tdewolff/minify/v2 from 2.12.7 to 2.12.8 (#2073) (diff) | |
download | gotosocial-be3718f6e4c7bb229f9eb78b44c52d14399977cc.tar.xz |
[chore] Use generic pointer function (#2080)
This replaces the different $TypePtr functions with a generic
implementation.
Diffstat (limited to 'internal/processing/fromclientapi_test.go')
-rw-r--r-- | internal/processing/fromclientapi_test.go | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/internal/processing/fromclientapi_test.go b/internal/processing/fromclientapi_test.go index 808f02cd6..94068e192 100644 --- a/internal/processing/fromclientapi_test.go +++ b/internal/processing/fromclientapi_test.go @@ -30,6 +30,7 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" "github.com/superseriousbusiness/gotosocial/internal/messages" "github.com/superseriousbusiness/gotosocial/internal/stream" + "github.com/superseriousbusiness/gotosocial/internal/util" "github.com/superseriousbusiness/gotosocial/testrig" ) @@ -63,20 +64,20 @@ func (suite *FromClientAPITestSuite) TestProcessStreamNewStatus() { EmojiIDs: []string{}, CreatedAt: testrig.TimeMustParse("2021-10-20T11:36:45Z"), UpdatedAt: testrig.TimeMustParse("2021-10-20T11:36:45Z"), - Local: testrig.TrueBool(), + Local: util.Ptr(true), AccountURI: "http://localhost:8080/users/admin", AccountID: "01F8MH17FWEB39HZJ76B6VXSKF", InReplyToID: "", BoostOfID: "", ContentWarning: "", Visibility: gtsmodel.VisibilityFollowersOnly, - Sensitive: testrig.FalseBool(), + Sensitive: util.Ptr(false), Language: "en", CreatedWithApplicationID: "01F8MGXQRHYF5QPMTMXP78QC2F", - Federated: testrig.FalseBool(), - Boostable: testrig.TrueBool(), - Replyable: testrig.TrueBool(), - Likeable: testrig.TrueBool(), + Federated: util.Ptr(false), + Boostable: util.Ptr(true), + Replyable: util.Ptr(true), + Likeable: util.Ptr(true), ActivityStreamsType: ap.ObjectNote, } @@ -189,7 +190,7 @@ func (suite *FromClientAPITestSuite) TestProcessNewStatusWithNotification() { // that receiving account wants notifs when posting account posts. follow := >smodel.Follow{} *follow = *suite.testFollows["local_account_1_admin_account"] - follow.Notify = testrig.TrueBool() + follow.Notify = util.Ptr(true) if err := suite.db.UpdateFollow(ctx, follow); err != nil { suite.FailNow(err.Error()) } @@ -206,20 +207,20 @@ func (suite *FromClientAPITestSuite) TestProcessNewStatusWithNotification() { EmojiIDs: []string{}, CreatedAt: testrig.TimeMustParse("2021-10-20T11:36:45Z"), UpdatedAt: testrig.TimeMustParse("2021-10-20T11:36:45Z"), - Local: testrig.TrueBool(), + Local: util.Ptr(true), AccountURI: "http://localhost:8080/users/admin", AccountID: "01F8MH17FWEB39HZJ76B6VXSKF", InReplyToID: "", BoostOfID: "", ContentWarning: "", Visibility: gtsmodel.VisibilityFollowersOnly, - Sensitive: testrig.FalseBool(), + Sensitive: util.Ptr(false), Language: "en", CreatedWithApplicationID: "01F8MGXQRHYF5QPMTMXP78QC2F", - Federated: testrig.FalseBool(), - Boostable: testrig.TrueBool(), - Replyable: testrig.TrueBool(), - Likeable: testrig.TrueBool(), + Federated: util.Ptr(false), + Boostable: util.Ptr(true), + Replyable: util.Ptr(true), + Likeable: util.Ptr(true), ActivityStreamsType: ap.ObjectNote, } |