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-datastore
Commits
196f6a61
Commit
196f6a61
authored
Jul 04, 2017
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix namespace test
parent
236b495e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
namespace/namespace_test.go
namespace/namespace_test.go
+8
-6
No files found.
namespace/namespace_test.go
View file @
196f6a61
...
...
@@ -100,13 +100,14 @@ func (ks *DSSuite) TestQuery(c *C) {
c
.
Check
(
err
,
Equals
,
nil
)
expect
:=
[]
dsq
.
Entry
{
{
Key
:
"/bar"
,
Value
:
[]
byte
(
"/foo/bar"
)},
{
Key
:
"/bar/baz"
,
Value
:
[]
byte
(
"/foo/bar/baz"
)},
{
Key
:
"/baz/abc"
,
Value
:
[]
byte
(
"/foo/baz/abc"
)},
{
Key
:
"/bar"
,
Value
:
[]
byte
(
"/foo/bar"
)},
{
Key
:
"/bar/baz"
,
Value
:
[]
byte
(
"/foo/bar/baz"
)},
{
Key
:
"/baz/abc"
,
Value
:
[]
byte
(
"/foo/baz/abc"
)},
}
results
,
err
:=
qres
.
Rest
()
c
.
Check
(
err
,
Equals
,
nil
)
sort
.
Slice
(
results
,
func
(
i
,
j
int
)
bool
{
return
results
[
i
]
.
Key
<
results
[
j
]
.
Key
})
for
i
,
ent
:=
range
results
{
c
.
Check
(
ent
.
Key
,
Equals
,
expect
[
i
]
.
Key
)
...
...
@@ -118,16 +119,17 @@ func (ks *DSSuite) TestQuery(c *C) {
err
=
qres
.
Close
()
c
.
Check
(
err
,
Equals
,
nil
)
qres
,
err
=
nsds
.
Query
(
dsq
.
Query
{
Prefix
:
"bar"
})
qres
,
err
=
nsds
.
Query
(
dsq
.
Query
{
Prefix
:
"bar"
})
c
.
Check
(
err
,
Equals
,
nil
)
expect
=
[]
dsq
.
Entry
{
{
Key
:
"/bar"
,
Value
:
[]
byte
(
"/foo/bar"
)},
{
Key
:
"/bar/baz"
,
Value
:
[]
byte
(
"/foo/bar/baz"
)},
{
Key
:
"/bar"
,
Value
:
[]
byte
(
"/foo/bar"
)},
{
Key
:
"/bar/baz"
,
Value
:
[]
byte
(
"/foo/bar/baz"
)},
}
results
,
err
=
qres
.
Rest
()
c
.
Check
(
err
,
Equals
,
nil
)
sort
.
Slice
(
results
,
func
(
i
,
j
int
)
bool
{
return
results
[
i
]
.
Key
<
results
[
j
]
.
Key
})
for
i
,
ent
:=
range
results
{
c
.
Check
(
ent
.
Key
,
Equals
,
expect
[
i
]
.
Key
)
...
...
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