Skip to content

Commit

Permalink
Fix bug in lrange with negative indices
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Wilke committed Mar 9, 2015
1 parent 789e8c9 commit 0db8a48
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 40 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ NOTE: version 0.0.5 will have full support for implemented and unimplemented. Ve
- HyperLogLog support.
## Versions
* 0.0.7-1
- lrange fix for negative indices.
* 0.0.7
- All string commands implemented.
- Better unit tests.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"url": "git://github.com/wilkenstein/redis-mock-js.git"
},
"main": "redis-mock.js",
"version": "0.0.7",
"version": "0.0.7-1",
"devDependencies": {
"q": "~1.0",
"chai": "~2.1",
Expand Down
28 changes: 13 additions & 15 deletions plato/files/redis_mock_js/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ <h1>redis-mock.js</h1>
<div class="row">
<div class="col-md-6">
<h2 class="header">Maintainability <a href="http://blogs.msdn.com/b/codeanalysis/archive/2007/11/20/maintainability-index-range-and-meaning.aspx"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="A value between 0 and 100 that represents the relative ease of maintaining the code. A high value means better maintainability." data-original-title="Maintainability Index"></i></a></h2>
<p class="stat">71.40</p>
<p class="stat">71.46</p>
</div>
<div class="col-md-6">
<h2 class="header">Lines of code <i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="Source Lines of Code / Logical Lines of Code" data-original-title="SLOC/LSLOC"></i></h2>
<p class="stat">2389</p>
<p class="stat">2387</p>
</div>
</div>
<div class="row historical">
Expand All @@ -63,11 +63,11 @@ <h2 class="header">Lines of code <i class="icon icon-info-sign" rel="popover" da
<div class="row">
<div class="col-md-6">
<h2 class="header">Difficulty <a href="http://en.wikipedia.org/wiki/Halstead_complexity_measures"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="The difficulty measure is related to the difficulty of the program to write or understand." data-original-title="Difficulty"></i></a></h2>
<p class="stat">245.61</p>
<p class="stat">244.18</p>
</div>
<div class="col-md-6">
<h2 class="header">Estimated Errors <a href="http://en.wikipedia.org/wiki/Halstead_complexity_measures"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="Halstead's delivered bugs is an estimate for the number of errors in the implementation." data-original-title="Delivered Bugs"></i></a></h2>
<p class="stat">29.71</p>
<p class="stat">29.62</p>
</div>
</div>
</div>
Expand Down Expand Up @@ -1180,24 +1180,22 @@ <h3 class="chart-header">By SLOC <i class="icon icon-info-sign" rel="popover" d
return this
.ifType(key, &#039;list&#039;, callback)
.thenex(function () {
var tmpS, tmpE;
if (start &gt; cache[key].length - 1) {
l = [];
}
else {
if (start &lt; 0 &amp;&amp; end &lt; 0) {
tmpS = cache[key].length + end;
tmpE = cache[key].length + start;
start = tmpS;
end = tmpE;
if (start &lt; 0) {
start = cache[key].length + start;
}
if (start &gt;= 0 &amp;&amp; end &lt; 0) {
if (end &lt; 0) {
end = cache[key].length + end;
}
if (end &gt; cache[key].length - 1) {
end = cache[key].length - 1;
if (start &gt; end) {
l = [];
}
else {
l = cache[key].slice(start, end + 1);
}
l = cache[key].slice(start, end + 1);
}
})
.then(function () { return l; })
Expand Down Expand Up @@ -2400,7 +2398,7 @@ <h3 class="chart-header">By SLOC <i class="icon icon-info-sign" rel="popover" d
// Modifications
// -------------

var modifiers = [&#039;del&#039;, &#039;set&#039;, &#039;lpush&#039;, &#039;rpush&#039;, &#039;lpop&#039;, &#039;rpop&#039;, &#039;ltrim&#039;, &#039;sadd&#039;, &#039;srem&#039;, &#039;zadd&#039;, &#039;zrem&#039;]; // TODO: Add the rest.
var modifiers = [&#039;del&#039;, &#039;set&#039;, &#039;lpush&#039;, &#039;rpush&#039;, &#039;lpop&#039;, &#039;rpop&#039;, &#039;ltrim&#039;, &#039;lset&#039;, &#039;sadd&#039;, &#039;srem&#039;, &#039;zadd&#039;, &#039;zrem&#039;]; // TODO: Add the rest.
var capture = {};
var fkeys = [];
for (var key in redismock) {
Expand Down
2 changes: 1 addition & 1 deletion plato/files/redis_mock_js/report.history.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0db8a48

Please sign in to comment.