aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-02-16 13:48:46 +0100
committerMichael Muré <batolettre@gmail.com>2019-03-01 22:40:24 +0100
commitcd7ed7ff9e3250c10e97fe16c934b5a6151527bb (patch)
treee0d6df60e2a04ccb72b3d4c63fc57b4546df458c /tests
parent21048e785d976a04e26798e4a385ee675c95b88f (diff)
downloadgit-bug-cd7ed7ff9e3250c10e97fe16c934b5a6151527bb.tar.gz
identity: add more test for serialisation and push/pull/merge + fixes
Diffstat (limited to 'tests')
-rw-r--r--tests/read_bugs_test.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/read_bugs_test.go b/tests/read_bugs_test.go
index 80d6cc1f..8b4379e7 100644
--- a/tests/read_bugs_test.go
+++ b/tests/read_bugs_test.go
@@ -4,11 +4,25 @@ import (
"testing"
"github.com/MichaelMure/git-bug/bug"
+ "github.com/MichaelMure/git-bug/misc/random_bugs"
+ "github.com/MichaelMure/git-bug/repository"
"github.com/MichaelMure/git-bug/util/test"
)
+func CreateFilledRepo(bugNumber int) repository.ClockedRepo {
+ repo := test.CreateRepo(false)
+
+ var seed int64 = 42
+ options := random_bugs.DefaultOptions()
+
+ options.BugNumber = bugNumber
+
+ random_bugs.CommitRandomBugsWithSeed(repo, options, seed)
+ return repo
+}
+
func TestReadBugs(t *testing.T) {
- repo := test.CreateFilledRepo(15)
+ repo := CreateFilledRepo(15)
bugs := bug.ReadAllLocalBugs(repo)
for b := range bugs {
if b.Err != nil {
@@ -18,7 +32,7 @@ func TestReadBugs(t *testing.T) {
}
func benchmarkReadBugs(bugNumber int, t *testing.B) {
- repo := test.CreateFilledRepo(bugNumber)
+ repo := CreateFilledRepo(bugNumber)
t.ResetTimer()
for n := 0; n < t.N; n++ {