/*!
 * arr-diff <https://github.com/jonschlinkert/arr-diff>
 *
 * Copyright (c) 2014 Jon Schlinkert, contributors.
 * Licensed under the MIT License
 */

'use strict';

var should = require('should');
var diff = require('./');

describe('diff', function () {
  it('should diff array:', function () {
    diff(['a', 'b', 'c'], ['b', 'c', 'e']).should.eql(['a']);
    diff(['foo', 'b', 'c', 'e', 'bar'], ['b', 'foo', 'e']).should.eql(['bar', 'c']);
    diff(['foo', 'foo'], ['a', 'b', 'c']).should.eql(['foo', 'foo']);
    diff(['foo'], ['a', 'b', 'c']).should.eql([]);
  });

  it('should return an empty array if no unique elements are in the first array:', function () {
    diff(['foo'], ['a', 'b', 'c', 'foo']).should.eql([]);
  });
});

@@ -362,27 +362,25 @@
 %0A    diff(%5B'
-foo
+x
 ', 'b', 'c',
@@ -386,19 +386,17 @@
 , 'e', '
-bar
+y
 '%5D, %5B'b'
@@ -398,19 +398,17 @@
  %5B'b', '
-foo
+x
 ', 'e'%5D)
@@ -425,16 +425,14 @@
 l(%5B'
-bar
+c
 ', '
-c
+y
 '%5D);
@@ -447,85 +447,345 @@
 f(%5B'
-foo', 'foo'%5D, %5B'a', 'b', 'c'%5D).should.eql(%5B'foo', 'foo'%5D);%0A    diff(%5B'foo'%5D, 
+x', 'x'%5D, %5B'a', 'b', 'c'%5D).should.eql(%5B'x', 'x'%5D);%0A    diff(%5B'x'%5D, %5B'a', 'b', 'c'%5D).should.eql(%5B'x'%5D);%0A  %7D);%0A%0A  it('should include duplicates:', function () %7B%0A    diff(%5B'x', 'b', 'b', 'b', 'c', 'e', 'y'%5D, %5B'x', 'e'%5D).should.eql(%5B'b', 'b', 'b', 'c', 'y'%5D);%0A  %7D);%0A%0A  it('should diff elements from multiple arrays:', function () %7B%0A    diff(
 %5B'a'
@@ -787,32 +787,46 @@
 (%5B'a', 'b', 'c'%5D
+, %5B'a'%5D, %5B'b'%5D
 ).should.eql(%5B%5D)
@@ -815,32 +815,35 @@
 '%5D).should.eql(%5B
+'c'
 %5D);%0A  %7D);%0A%0A  it(
@@ -949,35 +949,378 @@
 f(%5B'
-foo'%5D, %5B'a', 'b', 'c', 'foo
+a'%5D, %5B'a', 'b', 'c'%5D).should.eql(%5B%5D);%0A  %7D);%0A%0A  it('should return the first array if the second array is empty:', function () %7B%0A    diff(%5B'a', 'b', 'c'%5D, %5B%5D).should.eql(%5B'a', 'b', 'c'%5D);%0A  %7D);%0A%0A  it('should return the first array if the second array is null or undefined:', function () %7B%0A    diff(%5B'a', 'b', 'c'%5D, null).should.eql(%5B'a', 'b', 'c'%5D);%0A    diff(%5B'a', 'b', 'c
 '%5D).
@@ -1323,30 +1323,43 @@
 '%5D).should.eql(%5B
+'a', 'b', 'c'
 %5D);%0A  %7D);%0A%7D);%0A

update test