Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
8d94d7f8
Commit
8d94d7f8
authored
Mar 07, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
44cb53de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
t/neo/zodb/cmd/zodbdump/zodbdump_test.go
t/neo/zodb/cmd/zodbdump/zodbdump_test.go
+11
-3
No files found.
t/neo/zodb/cmd/zodbdump/zodbdump_test.go
View file @
8d94d7f8
...
...
@@ -12,9 +12,16 @@ import (
"../../../storage/fs1"
"../../../zodb"
"github.com/sergi/go-diff/diffmatchpatch"
"lab.nexedi.com/kirr/go123/exc"
)
func
diff
(
a
,
b
string
)
string
{
dmp
:=
diffmatchpatch
.
New
()
diffv
:=
dmp
.
DiffMain
(
a
,
b
,
/*checklines=*/
false
)
return
dmp
.
DiffPrettyText
(
diffv
)
}
func
TestZodbDump
(
t
*
testing
.
T
)
{
buf
:=
bytes
.
Buffer
{}
fs
,
err
:=
fs1
.
Open
(
"../../../storage/fs1/testdata/1.fs"
)
// XXX read-only, path?
...
...
@@ -29,12 +36,13 @@ func TestZodbDump(t *testing.T) {
t
.
Fatal
(
err
)
}
dumpOk
,
err
:=
ioutil
.
ReadFile
(
"testdata/1.zdump.ok"
)
__
,
err
:=
ioutil
.
ReadFile
(
"testdata/1.zdump.ok"
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
dumpOk
:=
string
(
__
)
if
!
bytes
.
Equal
(
dumpOk
,
buf
.
Bytes
()
)
{
t
.
Errorf
(
"dump different
TODO show diff"
)
// XXX github.com/sergi/go-diff.git
if
dumpOk
!=
buf
.
String
(
)
{
t
.
Errorf
(
"dump different
:
\n
%v"
,
diff
(
dumpOk
,
buf
.
String
()))
}
}
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