Skip to content

Instantly share code, notes, and snippets.

@antirez
Created September 23, 2010 15:03
Show Gist options
  • Select an option

  • Save antirez/593762 to your computer and use it in GitHub Desktop.

Select an option

Save antirez/593762 to your computer and use it in GitHub Desktop.
start_server {
tags {"list"}
overrides {
"list-max-ziplist-value" 512
"list-max-ziplist-entries" 1024
}
} {
test {ziplist implementation stress testing} {
for {set j 0} {$j < 100} {incr j} {
r del l
set l {}
for {set i 0} {$i < 200} {incr i} {
set rv [randomValue]
randpath {
lappend l $rv
r rpush l $rv
} {
set l [concat [list $rv] $l]
r lpush l $rv
}
}
assert_equal [llength $l] [r llen l]
for {set i 0} {$i < 200} {incr i} {
assert_equal [lindex $l $i] [r lindex l $i]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment