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
c744c005
Commit
c744c005
authored
Oct 18, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
1621b543
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
7 deletions
+20
-7
go/internal/xtesting/xtesting.go
go/internal/xtesting/xtesting.go
+11
-0
go/neo/client_test.go
go/neo/client_test.go
+8
-0
go/zodb/storage/zeo/zeo_test.go
go/zodb/storage/zeo/zeo_test.go
+1
-7
No files found.
go/internal/xtesting/xtesting.go
View file @
c744c005
...
@@ -138,6 +138,17 @@ func ZPyCommitRaw(zurl string, at zodb.Tid, objv ...ZRawObject) (_ zodb.Tid, err
...
@@ -138,6 +138,17 @@ func ZPyCommitRaw(zurl string, at zodb.Tid, objv ...ZRawObject) (_ zodb.Tid, err
// ---- tests for storage drivers ----
// ---- tests for storage drivers ----
// DrvTestEmptyDB verifies that zdrv works correctly on empty database.
func
DrvTestEmptyDB
(
t
*
testing
.
T
,
zdrv
zodb
.
IStorageDriver
)
{
X
:=
FatalIf
(
t
)
ctx
:=
context
.
Background
()
head
,
err
:=
zdrv
.
Sync
(
ctx
);
X
(
err
)
headOk
:=
zodb
.
Tid
(
0
)
if
head
!=
headOk
{
t
.
Errorf
(
"head=%s ; expected %s"
,
head
,
headOk
)
}
}
// state of an object in the database for some particular revision
// state of an object in the database for some particular revision
type
objState
struct
{
type
objState
struct
{
tid
zodb
.
Tid
tid
zodb
.
Tid
...
...
go/neo/client_test.go
View file @
c744c005
...
@@ -183,3 +183,11 @@ func withNEOSrv(t *testing.T, f func(t *testing.T, nsrv NEOSrv)) { // XXX +optv
...
@@ -183,3 +183,11 @@ func withNEOSrv(t *testing.T, f func(t *testing.T, nsrv NEOSrv)) { // XXX +optv
// TODO NEO/go
// TODO NEO/go
}
}
// XXX withNeo
func
TestEmptyDB
(
t
*
testing
.
T
)
{
withNEO
(
t
,
func
(
t
*
testing
.
T
,
nsrv
NEOSrv
,
n
*
Client
)
{
xtesting
.
DrvTestEmptyDB
(
t
,
n
)
})
}
go/zodb/storage/zeo/zeo_test.go
View file @
c744c005
...
@@ -247,13 +247,7 @@ func TestHandshake(t *testing.T) {
...
@@ -247,13 +247,7 @@ func TestHandshake(t *testing.T) {
// verify that connection to ZEO server with empty DB works ok.
// verify that connection to ZEO server with empty DB works ok.
func
TestEmptyDB
(
t
*
testing
.
T
)
{
func
TestEmptyDB
(
t
*
testing
.
T
)
{
withZEO
(
t
,
func
(
t
*
testing
.
T
,
zsrv
ZEOSrv
,
z
*
zeo
)
{
withZEO
(
t
,
func
(
t
*
testing
.
T
,
zsrv
ZEOSrv
,
z
*
zeo
)
{
X
:=
xtesting
.
FatalIf
(
t
)
xtesting
.
DrvTestEmptyDB
(
t
,
z
)
ctx
:=
context
.
Background
()
head
,
err
:=
z
.
Sync
(
ctx
);
X
(
err
)
headOk
:=
zodb
.
Tid
(
0
)
if
head
!=
headOk
{
t
.
Errorf
(
"head=%s ; expected %s"
,
head
,
headOk
)
}
})
})
}
}
...
...
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