Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
8e1f48ce
Commit
8e1f48ce
authored
Sep 30, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b14154b6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
wcfs/zblk.go
wcfs/zblk.go
+2
-2
wcfs/zblk_test.go
wcfs/zblk_test.go
+11
-2
No files found.
wcfs/zblk.go
View file @
8e1f48ce
...
@@ -299,13 +299,13 @@ type ZBigFile struct {
...
@@ -299,13 +299,13 @@ type ZBigFile struct {
type
zBigFileState
ZBigFile
// hide state methods from public API
type
zBigFileState
ZBigFile
// hide state methods from public API
// DropState implements Stateful.
// DropState implements
zodb.
Stateful.
func
(
bf
*
zBigFileState
)
DropState
()
{
func
(
bf
*
zBigFileState
)
DropState
()
{
bf
.
blksize
=
-
1
bf
.
blksize
=
-
1
bf
.
blktab
=
nil
bf
.
blktab
=
nil
}
}
// PySetState implements PyStateful.
// PySetState implements
zodb.
PyStateful.
func
(
bf
*
zBigFileState
)
PySetState
(
pystate
interface
{})
(
err
error
)
{
func
(
bf
*
zBigFileState
)
PySetState
(
pystate
interface
{})
(
err
error
)
{
// ZBigFile
// ZBigFile
// .blksize xint
// .blksize xint
...
...
wcfs/zblk_test.go
View file @
8e1f48ce
...
@@ -39,6 +39,7 @@ import (
...
@@ -39,6 +39,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)
)
// TestZBlk verifies that ZBlk* and ZBigFile saved by Python can be read correctly by Go.
func
TestZBlk
(
t
*
testing
.
T
)
{
func
TestZBlk
(
t
*
testing
.
T
)
{
X
:=
exc
.
Raiseif
X
:=
exc
.
Raiseif
assert
:=
require
.
New
(
t
)
assert
:=
require
.
New
(
t
)
...
@@ -101,7 +102,15 @@ func TestZBlk(t *testing.T) {
...
@@ -101,7 +102,15 @@ func TestZBlk(t *testing.T) {
t
.
Fatalf
(
"zf: blksize=%d; want %d"
,
zf
.
blksize
,
blksize
)
t
.
Fatalf
(
"zf: blksize=%d; want %d"
,
zf
.
blksize
,
blksize
)
}
}
// XXX zf.blktab.Get(0) -> z0
z0_
,
ok
,
err
:=
zf
.
blktab
.
Get
(
ctx
,
0
);
X
(
err
)
// XXX zf.blktab.Get(1) -> z1
if
!
(
ok
&&
z0_
==
z0
)
{
t
.
Fatalf
(
"zf: [0] -> %#v; want z0"
,
z0_
)
}
z1_
,
ok
,
err
:=
zf
.
blktab
.
Get
(
ctx
,
1
);
X
(
err
)
if
!
(
ok
&&
z1_
==
z1
)
{
t
.
Fatalf
(
"zf: [1] -> %#v; want z1"
,
z1_
)
}
// XXX check zf.blktab.MaxKey ?
}
}
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