time-to-botec

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

diag-test.js (627B)


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