Skip to content

Commit

Permalink
Use testdata
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Weber committed Aug 13, 2019
1 parent 9d66591 commit 31d27f0
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fold/fold_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"regexp"
"compress/gzip"
"os"
"path/filepath"

. "github.com/smartystreets/goconvey/convey"
"github.com/weberr13/go-reducers/monoid"
Expand Down Expand Up @@ -105,7 +106,7 @@ func (f WordCount) Two(b monoid.CommutativeMonoid) monoid.CommutativeMonoid {
}

func WarAndPeaceCount(b *testing.B, forDepth int, foldDepth int, readlines int, linebundle int) {
filename := "WarAndPeace_LeoTolstoy.txt.gz"
filename := filepath.Join("testdata", "WarAndPeace_LeoTolstoy.txt.gz")
file, err := os.Open(filename)
if err != nil {
b.Fatal(err)
Expand Down Expand Up @@ -134,7 +135,7 @@ func WarAndPeaceCount(b *testing.B, forDepth int, foldDepth int, readlines int,
}
count++
}
expectedFile := fmt.Sprintf("WarAndPeaceResults.%d.json", readlines)
expectedFile := filepath.Join("testdata", fmt.Sprintf("WarAndPeaceResults.%d.json", readlines))
refdata, _ := ioutil.ReadFile(expectedFile)
refmap := make(map[string]interface{})
err = json.Unmarshal(refdata, &refmap)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 31d27f0

Please sign in to comment.