Skip to content

Commit

Permalink
Update Version to reflect fsrepo change
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Zander Mackie <zmackie@gmail.com>
  • Loading branch information
zmackie committed Jan 20, 2017
1 parent 98ebae7 commit 37b869d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions repo/fsrepo/migrations/mfsr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package mfsr
import (
"io/ioutil"
"os"
"strconv"
"testing"

"github.com/ipfs/go-ipfs/thirdparty/assert"
Expand All @@ -28,13 +29,15 @@ func TestVersion(t *testing.T) {
t.Fatalf("Should throw an `IsNotExist` error when file doesn't exist: %v", err)
}

rp = testVersionFile("4", t)
fsrepoV := 5

rp = testVersionFile(strconv.Itoa(fsrepoV), t)
_, err = rp.Version()
assert.Err(err, t, "Bad VersionFile")

assert.Nil(rp.WriteVersion(4), t, "Trouble writing version")
assert.Nil(rp.WriteVersion(fsrepoV), t, "Trouble writing version")

assert.Nil(rp.CheckVersion(4), t, "Trouble checking the verion")
assert.Nil(rp.CheckVersion(fsrepoV), t, "Trouble checking the verion")

assert.Err(rp.CheckVersion(1), t, "Should throw an error for the wrong version.")
}

0 comments on commit 37b869d

Please sign in to comment.