time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

rows-test.js (655B)


      1 var vows = require('vows');
      2 var assert = require('assert');
      3 var suite = vows.describe('jStat.rows');
      4 
      5 require('../env.js');
      6 
      7 suite.addBatch({
      8   'rows': {
      9     'topic': function() {
     10       return jStat;
     11     },
     12     'number of rows': function(jStat) {
     13       assert.equal(jStat.rows([[1], [4], [5]]), 3);
     14       assert.equal(jStat([[1], [4], [5]]).rows(), 3);
     15       assert.isTrue(jStat([[1], [3]]).rows(function() {}) instanceof jStat);
     16     }
     17   },
     18   '#rows': {
     19     'topic': function() {
     20       jStat([[1, 2, 3], [4, 5, 6]]).rows(this.callback);
     21     },
     22     'rows sends value': function(val, stat) {
     23       assert.equal(val, 2);
     24     }
     25   }
     26 });
     27 
     28 suite.export(module);