Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
eb5ba9d7
Commit
eb5ba9d7
authored
Jan 20, 2017
by
Zander Mackie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests for msfr
License: MIT Signed-off-by:
Zander Mackie
<
zmackie@gmail.com
>
parent
4028e890
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
repo/fsrepo/migrations/mfsr_test.go
repo/fsrepo/migrations/mfsr_test.go
+33
-0
No files found.
repo/fsrepo/migrations/mfsr_test.go
0 → 100644
View file @
eb5ba9d7
package
mfsr
import
(
"io/ioutil"
"testing"
"github.com/ipfs/go-ipfs/thirdparty/assert"
)
func
testVersionFile
(
v
string
,
t
*
testing
.
T
)
(
rp
RepoPath
)
{
name
,
err
:=
ioutil
.
TempDir
(
""
,
v
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
rp
=
RepoPath
(
name
)
return
rp
}
func
TestVersion
(
t
*
testing
.
T
)
{
rp
:=
RepoPath
(
""
)
_
,
err
:=
rp
.
Version
()
assert
.
Err
(
err
,
t
,
"Should throw an error when path is bad,"
)
rp
=
testVersionFile
(
"4"
,
t
)
_
,
err
=
rp
.
Version
()
assert
.
Err
(
err
,
t
,
"Bad VersionFile"
)
assert
.
Nil
(
rp
.
WriteVersion
(
4
),
t
,
"Trouble writing version"
)
assert
.
Nil
(
rp
.
CheckVersion
(
4
),
t
,
"Trouble checking the verion"
)
assert
.
Err
(
rp
.
CheckVersion
(
1
),
t
,
"Should throw an error for the wrong version."
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment