From c3bb3a7f94418f3acc44a9768d8de98d0ef14593 Mon Sep 17 00:00:00 2001 From: Lukasz Mierzwa Date: Wed, 17 Jul 2024 09:08:48 +0100 Subject: [PATCH] Test for comment length --- internal/reporter/bitbucket_comments_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/reporter/bitbucket_comments_test.go b/internal/reporter/bitbucket_comments_test.go index ec908269..91547172 100644 --- a/internal/reporter/bitbucket_comments_test.go +++ b/internal/reporter/bitbucket_comments_test.go @@ -9,6 +9,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/neilotoole/slogt" + "github.com/stretchr/testify/require" "github.com/cloudflare/pint/internal/checks" "github.com/cloudflare/pint/internal/discovery" @@ -627,6 +628,9 @@ func TestBitBucketMakeComments(t *testing.T) { t.Errorf("api.makeComments() returned wrong output (-want +got):\n%s", diff) return } + for _, comment := range comments { + require.LessOrEqual(t, len(comment.Text), maxCommentLength) + } }) } }