aboutsummaryrefslogtreecommitdiffstats
path: root/cache
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2021-03-29 10:08:57 +0200
committerMichael Muré <batolettre@gmail.com>2021-03-29 10:08:57 +0200
commite985653701e8438e27ee5f925fd0aa7c0eef09fe (patch)
treec9267e77652810708771717f4a754b6701bf4d9c /cache
parent32958b5ca1901e8062bc67c9a03675ffd8ef4fa7 (diff)
downloadgit-bug-e985653701e8438e27ee5f925fd0aa7c0eef09fe.tar.gz
cache: test for FTS bub with long description
Diffstat (limited to 'cache')
-rw-r--r--cache/repo_cache_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/cache/repo_cache_test.go b/cache/repo_cache_test.go
index bd06e84d..7e648ea9 100644
--- a/cache/repo_cache_test.go
+++ b/cache/repo_cache_test.go
@@ -1,7 +1,9 @@
package cache
import (
+ "strings"
"testing"
+ "time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -274,3 +276,21 @@ func checkBugPresence(t *testing.T, cache *RepoCache, bug *BugCache, presence bo
require.Equal(t, bug, b)
}
}
+
+func TestLongDescription(t *testing.T) {
+ // See https://github.com/MichaelMure/git-bug/issues/606
+
+ text := strings.Repeat("x", 65536)
+
+ repo := repository.CreateGoGitTestRepo(false)
+ defer repository.CleanupTestRepos(repo)
+
+ backend, err := NewRepoCache(repo)
+ require.NoError(t, err)
+
+ i, err := backend.NewIdentity("René Descartes", "rene@descartes.fr")
+ require.NoError(t, err)
+
+ _, _, err = backend.NewBugRaw(i, time.Now().Unix(), text, text, nil, nil)
+ require.NoError(t, err)
+}