"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/unit/type/set.tcl" between
redis-6.2-rc3.tar.gz and redis-6.2.0.tar.gz

About: redis is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

set.tcl  (redis-6.2-rc3):set.tcl  (redis-6.2.0)
skipping to change at line 518 skipping to change at line 518
if {[lsort [array names myset]] eq if {[lsort [array names myset]] eq
[lsort [array names auxset]]} { [lsort [array names auxset]]} {
break; break;
} }
} }
assert {$iterations != 0} assert {$iterations != 0}
} }
} }
} }
foreach {type contents} {
hashtable {
1 5 10 50 125
MARY PATRICIA LINDA BARBARA ELIZABETH
}
intset {
0 1 2 3 4 5 6 7 8 9
}
} {
test "SRANDMEMBER histogram distribution - $type" {
create_set myset $contents
unset -nocomplain myset
array set myset {}
foreach ele [r smembers myset] {
set myset($ele) 1
}
# Use negative count (PATH 1).
set res [r srandmember myset -1000]
assert_equal [check_histogram_distribution $res 0.05 0.15] true
# Use positive count (both PATH 3 and PATH 4).
foreach size {8 2} {
unset -nocomplain allkey
set iterations [expr {1000 / $size}]
while {$iterations != 0} {
incr iterations -1
set res [r srandmember myset $size]
foreach ele $res {
lappend allkey $ele
}
}
assert_equal [check_histogram_distribution $allkey 0.05 0.15] tr
ue
}
}
}
proc setup_move {} { proc setup_move {} {
r del myset3 myset4 r del myset3 myset4
create_set myset1 {1 a b} create_set myset1 {1 a b}
create_set myset2 {2 3 4} create_set myset2 {2 3 4}
assert_encoding hashtable myset1 assert_encoding hashtable myset1
assert_encoding intset myset2 assert_encoding intset myset2
} }
test "SMOVE basics - from regular set to intset" { test "SMOVE basics - from regular set to intset" {
# move a non-integer element to an intset should convert encoding # move a non-integer element to an intset should convert encoding
 End of changes. 1 change blocks. 
0 lines changed or deleted 38 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)