Skip to content

Commit

Permalink
Fixes add() without a name
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgorbatchev committed Aug 7, 2015
1 parent 8f42519 commit d2d3321
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ console.log('')
function add(bench) {
exports.store.push(bench)

var id = bench.id;
var len = (bench.name || (Number.isNaN(id) ? id : '<Test #' + id + '>')).length
name_maxlen = len > name_maxlen ? len : name_maxlen
var ops = bench.hz.toFixed(bench.hz < 100 ? 2 : 0)
Expand Down
3 changes: 3 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ suite.add('current', function() {
.add('random blaaaah', function() {
return ~getSlowRandom() ? false: true
})
.add(function() {
return ~getRandom() ? false: true
})
.on('cycle', function(event) {
benchmarks.add(event.target)
})
Expand Down

0 comments on commit d2d3321

Please sign in to comment.