"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _tuple = require("../../lib/data/tuple");
var _default = exports["default"] = {
  setUp: function setUp(done) {
    done();
  },
  'empty tuple': function empty_tuple(test) {
    test.expect(1);
    // tests here
    test.equal((0, _tuple.tuple)().isEmpty(), true, 'should be empty.');
    test.done();
  },
  'non empty tuple': function non_empty_tuple(test) {
    test.expect(1);
    // tests here
    test.equal((0, _tuple.tuple)().append(1).isEmpty(), false, 'should not be empty.');
    test.done();
  },
  'initiated tuple': function initiated_tuple(test) {
    test.deepEqual((0, _tuple.tuple)([2, 4, 6]).value, [2, 4, 6]);
    test.done();
  },
  'retrieve non empty array': function retrieve_non_empty_array(test) {
    test.expect(1);
    // tests here
    test.deepEqual(new _tuple.Tuple([1, 2]).array(), [1, 2], 'should not be empty.');
    test.done();
  },
  'retrieve joined characters array': function retrieve_joined_characters_array(test) {
    test.expect(1);
    // tests here
    test.deepEqual(new _tuple.Tuple(['1', '2']).join(''), '12', 'should be "12".');
    test.done();
  },
  'tuple size': function tuple_size(test) {
    test.expect(1);
    // tests here
    var myTuple = new _tuple.Tuple([1, 2, 3, 4]);
    test.equal(4, myTuple.size());
    test.done();
  },
  'undefined tuple is empty': function undefined_tuple_is_empty(test) {
    var t = new _tuple.Tuple();
    test.equal(0, t.size());
    t = t.append(2);
    test.deepEqual([2], t.value);
    test.done();
  },
  'single is returning the first element of the tuple': function single_is_returning_the_first_element_of_the_tuple(test) {
    var l = new _tuple.Tuple([1, 2]);
    test.equal(1, l.single());
    test.done();
  },
  'NEUTRAL is not added to the tuple': function NEUTRAL_is_not_added_to_the_tuple(test) {
    var v = _tuple.NEUTRAL;
    var vTuple = (0, _tuple.tuple)().append(_tuple.NEUTRAL);
    test.equal(vTuple.size(), 0);
    vTuple = vTuple.append(v).append(3).append(v).append(5);
    test.equal(vTuple.size(), 2);
    test.done();
  },
  'tuple and NEUTRAL can be added in a Tuple': function tuple_and_NEUTRAL_can_be_added_in_a_Tuple(test) {
    var flat = new _tuple.Tuple([2, 4, 5]);
    var result = (0, _tuple.tuple)().append(_tuple.NEUTRAL).append(flat).append(1).append(_tuple.NEUTRAL);
    test.deepEqual(result, new _tuple.Tuple([2, 4, 5, 1]));
    test.done();
  },
  'empty tuple append to empty tuple is an empty tuple': function empty_tuple_append_to_empty_tuple_is_an_empty_tuple(test) {
    var result = (0, _tuple.tuple)().append((0, _tuple.tuple)());
    test.deepEqual(result, (0, _tuple.tuple)());
    test.done();
  },
  'last() returns the last element': function last_returns_the_last_element(test) {
    var result = new _tuple.Tuple([2, 4, 6]).last();
    test.equal(result, 6);
    test.done();
  },
  'first() returns the first element': function first_returns_the_first_element(test) {
    var result = new _tuple.Tuple([2, 4, 6]).first();
    test.equal(result, 2);
    test.done();
  },
  'at returns the value at index': function at_returns_the_value_at_index(test) {
    var result = new _tuple.Tuple([2, 4, 6]);
    test.equal(result.at(1), 4);
    test.done();
  }
};
//# sourceMappingURL=tuple-test.js.map