Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
4f7db880
Commit
4f7db880
authored
Feb 16, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
eb24bbcc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
2 deletions
+54
-2
t/neo/storage/fs1/gen-testdata
t/neo/storage/fs1/gen-testdata
+38
-0
t/neo/storage/fs1/index_test.go
t/neo/storage/fs1/index_test.go
+16
-2
No files found.
t/neo/storage/fs1/gen-testdata
0 → 100755
View file @
4f7db880
#!/usr/bin/env python2
"""generate reference index and database for tests"""
import
ZODB
import
persistent
import
transaction
def
commit
(
user
,
description
,
extension
):
txn
=
transaction
.
get
()
txn
.
user
=
user
txn
.
description
=
description
txn
.
extension
=
extension
txn
.
commit
()
def
main
():
stor
=
FileStorage
(
"testdata/1.fs"
,
create
=
True
)
db
=
DB
(
stor
)
conn
=
db
.
open
()
root
=
conn
.
root
()
commit
(
u"root"
,
u"initial database creation"
,
{
"x-generator"
:
"zodb/py2"
})
"""
root["..."] = obj
txn = transaction.get()
txn.user = u"user1" # XXX
txn.description = u"description1" # XXX
txn.extension = {"key1": value1, "key2": value2) # XXX
txn.commit()
"""
conn
.
close
()
db
.
close
()
stor
.
close
()
if
__name__
==
'__main__'
:
main
()
t/neo/storage/fs1/index_test.go
View file @
4f7db880
...
...
@@ -2,10 +2,13 @@
package
fs1
//go:generate ./gen-testdata
import
(
"fmt"
"io/ioutil"
"os"
"os/exec"
"sort"
"strings"
"testing"
...
...
@@ -80,6 +83,7 @@ func treeEqual(a, b *fsb.Tree) bool {
return
true
}
// XXX unneded after Tree.Dump() was made to work ok
func
treeString
(
t
*
fsb
.
Tree
)
string
{
entryv
:=
[]
string
{}
...
...
@@ -156,7 +160,6 @@ func TestIndexLookup(t *testing.T) {
}
}
//
func
TestIndexSaveLoad
(
t
*
testing
.
T
)
{
workdir
,
err
:=
ioutil
.
TempDir
(
""
,
"t-index"
)
if
err
!=
nil
{
...
...
@@ -187,7 +190,18 @@ func TestIndexSaveLoad(t *testing.T) {
//t.Errorf("index load: trees mismatch:\nhave: %v\nwant: %v", treeString(fsi2.Tree), treeString(fsi.Tree))
}
// TODO check with
// {0xb000000000000000, 0x7fffffffffffffff}, // will cause 'entry position too large'
}
var
havePyZODB
=
false
func
init
()
{
cmd
:=
exec
.
Command
(
"python2"
,
"-c"
,
"import ZODB"
)
err
:=
cmd
.
Run
()
if
err
==
nil
{
havePyZODB
=
true
}
println
(
"havePyZODB:"
,
havePyZODB
)
}
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