Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BTrees
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
BTrees
Commits
e0058b60
Commit
e0058b60
authored
Dec 12, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MOar range-object madness.
parent
1fc6edb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
BTrees/tests/common.py
BTrees/tests/common.py
+8
-8
No files found.
BTrees/tests/common.py
View file @
e0058b60
...
@@ -547,7 +547,7 @@ class MappingBase(Base):
...
@@ -547,7 +547,7 @@ class MappingBase(Base):
def
testIterators
(
self
):
def
testIterators
(
self
):
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
for
keys
in
[],
[
-
2
],
[
1
,
4
],
range
(
-
170
,
2000
,
6
):
for
keys
in
[],
[
-
2
],
[
1
,
4
],
list
(
range
(
-
170
,
2000
,
6
)
):
t
.
clear
()
t
.
clear
()
for
k
in
keys
:
for
k
in
keys
:
t
[
k
]
=
-
3
*
k
t
[
k
]
=
-
3
*
k
...
@@ -576,7 +576,7 @@ class MappingBase(Base):
...
@@ -576,7 +576,7 @@ class MappingBase(Base):
def
testRangedIterators
(
self
):
def
testRangedIterators
(
self
):
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
for
keys
in
[],
[
-
2
],
[
1
,
4
],
range
(
-
170
,
2000
,
13
):
for
keys
in
[],
[
-
2
],
[
1
,
4
],
list
(
range
(
-
170
,
2000
,
13
)
):
t
.
clear
()
t
.
clear
()
values
=
[]
values
=
[]
for
k
in
keys
:
for
k
in
keys
:
...
@@ -831,7 +831,7 @@ class BTreeTests(MappingBase):
...
@@ -831,7 +831,7 @@ class BTreeTests(MappingBase):
import
random
import
random
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
added
=
{}
added
=
{}
r
=
range
(
100
)
r
=
list
(
range
(
100
)
)
for
x
in
r
:
for
x
in
r
:
k
=
random
.
choice
(
r
)
k
=
random
.
choice
(
r
)
if
k
not
in
added
:
if
k
not
in
added
:
...
@@ -846,7 +846,7 @@ class BTreeTests(MappingBase):
...
@@ -846,7 +846,7 @@ class BTreeTests(MappingBase):
import
random
import
random
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
added
=
{}
added
=
{}
r
=
range
(
100
)
r
=
list
(
range
(
100
)
)
for
x
in
r
:
for
x
in
r
:
k
=
random
.
choice
(
r
)
k
=
random
.
choice
(
r
)
t
[
k
]
=
x
t
[
k
]
=
x
...
@@ -859,7 +859,7 @@ class BTreeTests(MappingBase):
...
@@ -859,7 +859,7 @@ class BTreeTests(MappingBase):
def
testRandomDeletes
(
self
):
def
testRandomDeletes
(
self
):
import
random
import
random
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
r
=
range
(
1000
)
r
=
list
(
range
(
1000
)
)
added
=
[]
added
=
[]
for
x
in
r
:
for
x
in
r
:
k
=
random
.
choice
(
r
)
k
=
random
.
choice
(
r
)
...
@@ -884,7 +884,7 @@ class BTreeTests(MappingBase):
...
@@ -884,7 +884,7 @@ class BTreeTests(MappingBase):
def
testTargetedDeletes
(
self
):
def
testTargetedDeletes
(
self
):
import
random
import
random
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
r
=
range
(
1000
)
r
=
list
(
range
(
1000
)
)
for
x
in
r
:
for
x
in
r
:
k
=
random
.
choice
(
r
)
k
=
random
.
choice
(
r
)
t
[
k
]
=
x
t
[
k
]
=
x
...
@@ -898,7 +898,7 @@ class BTreeTests(MappingBase):
...
@@ -898,7 +898,7 @@ class BTreeTests(MappingBase):
def
testPathologicalRightBranching
(
self
):
def
testPathologicalRightBranching
(
self
):
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
r
=
range
(
1000
)
r
=
list
(
range
(
1000
)
)
for
x
in
r
:
for
x
in
r
:
t
[
x
]
=
1
t
[
x
]
=
1
self
.
assertEqual
(
realseq
(
t
.
keys
())
,
r
,
realseq
(
t
.
keys
()))
self
.
assertEqual
(
realseq
(
t
.
keys
())
,
r
,
realseq
(
t
.
keys
()))
...
@@ -909,7 +909,7 @@ class BTreeTests(MappingBase):
...
@@ -909,7 +909,7 @@ class BTreeTests(MappingBase):
def
testPathologicalLeftBranching
(
self
):
def
testPathologicalLeftBranching
(
self
):
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
r
=
range
(
1000
)
r
=
list
(
range
(
1000
)
)
revr
=
list
(
reversed
(
r
[:]))
revr
=
list
(
reversed
(
r
[:]))
for
x
in
revr
:
for
x
in
revr
:
t
[
x
]
=
1
t
[
x
]
=
1
...
...
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