time-to-botec

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

copy-test.js (456B)


      1 var vows = require('vows');
      2 var assert = require('assert');
      3 var suite = vows.describe('jStat');
      4 
      5 require('../env.js');
      6 
      7 suite.addBatch({
      8   'copy-test': {
      9     'topic': function() {
     10       return jStat;
     11     },
     12     'example1': function(jStat) {
     13       var A = [[1,2],[3,4]];
     14       var B = A;
     15       B[0][0] = 0;
     16       assert.equal(A[0][0], 0);
     17       var C = jStat.copy(A);
     18       C[0][0] = -1;
     19       assert.equal(A[0][0], 0);
     20     }
     21   }
     22 });
     23 
     24 suite.export(module);