time-to-botec

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

antidiag-test.js (682B)


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