diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/read_bugs_test.go | 18 |
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++ { |