'use strict'

const nj = require('../bower_components/numjs/dist/numjs')
const assert = require('assert')
const _ = require('underscore')

const njUtil = require('../lib/nj_util')

describe('njUtil', function() {
  describe('array_equals', function() {
    it('should return true for equal arrays', function() {
      const arr1 = nj.array([1, 2, 3])
      const arr2 = nj.array([1, 2, 3])
      assert(njUtil.array_equals(arr1, arr2))
    })
    it('should return true for equal arrays', function() {
      const arr1 = nj.array([1, 2, 3])
      const arr2 = nj.array([1, 2, 3])
      assert(njUtil.array_equals(arr1, arr2))
    })
  })
  describe('diff', function() {
    it('should return the correct array for a 3x1 array', function() {
      const arr = nj.array([1, 2, 4, 7, 0])  
      const diff = njUtil.diff(arr)  
      const expected = nj.array([1, 2, 3, -7])
      console.log(diff)
      assert(njUtil.array_equals(diff, expected))
    })
    it('should return the correct array for a 2x3 array', function() {
      const arr = nj.array([[1, 2, 3], [1, 2, 3]])  
      const diff = njUtil.diff(arr)  
      const expected = nj.array([[1, 1], [1, 1]])
      assert(njUtil.array_equals(diff, expected))
    })
  })
})


@@ -210,433 +210,8 @@
 ) %7B%0A
-  describe('array_equals', function() %7B%0A    it('should return true for equal arrays', function() %7B%0A      const arr1 = nj.array(%5B1, 2, 3%5D)%0A      const arr2 = nj.array(%5B1, 2, 3%5D)%0A      assert(njUtil.array_equals(arr1, arr2))%0A    %7D)%0A    it('should return true for equal arrays', function() %7B%0A      const arr1 = nj.array(%5B1, 2, 3%5D)%0A      const arr2 = nj.array(%5B1, 2, 3%5D)%0A      assert(njUtil.array_equals(arr1, arr2))%0A    %7D)%0A  %7D)%0A
   de
@@ -234,24 +234,24 @@
 unction() %7B%0A
+
     it('shou
@@ -444,32 +444,8 @@
 7%5D)%0A
-      console.log(diff)%0A
     
@@ -455,33 +455,22 @@
 ssert(nj
-Util.array_
+.
 equal
-s
 (diff, e
@@ -717,25 +717,539 @@
 t(nj
-Util.array_equals
+.equal(diff, expected))%0A    %7D)%0A    it('should return the correct array for a 2x3 array on axis 0', function() %7B%0A      const arr = nj.array(%5B%5B1, 2, 3%5D, %5B1, 2, 3%5D%5D)  %0A      const diff = njUtil.diff(arr, 1, 0)  %0A      const expected = nj.array(%5B%5B0, 0, 0%5D%5D)%0A      assert(nj.equal(diff, expected))%0A    %7D)%0A    it('should return the correct array for a array with n = 2', function() %7B%0A      const arr = nj.array(%5B1, 2, 4, 7, 0%5D)  %0A      const diff = njUtil.diff(arr, 2)  %0A      const expected = nj.array(%5B1, 1, -10%5D)%0A      assert(nj.equal
 (dif

removed nj array equals