"use strict";

var _vitest = require("vitest");
var _tuple = require("../../lib/data/tuple.js");
// Added .js extension

(0, _vitest.describe)('Tuple Data Type Tests', function () {
  // Original test: 'empty tuple'
  (0, _vitest.it)('empty tuple', function () {
    (0, _vitest.expect)((0, _tuple.tuple)().isEmpty()).toBe(true);
  });

  // Original test: 'non empty tuple'
  (0, _vitest.it)('non empty tuple', function () {
    (0, _vitest.expect)((0, _tuple.tuple)().append(1).isEmpty()).toBe(false);
  });

  // Original test: 'initiated tuple'
  (0, _vitest.it)('initiated tuple', function () {
    (0, _vitest.expect)((0, _tuple.tuple)([2, 4, 6]).value).toEqual([2, 4, 6]);
  });

  // Original test: 'retrieve non empty array'
  (0, _vitest.it)('retrieve non empty array', function () {
    (0, _vitest.expect)(new _tuple.Tuple([1, 2]).array()).toEqual([1, 2]);
  });

  // Original test: 'retrieve joined characters array'
  (0, _vitest.it)('retrieve joined characters array', function () {
    (0, _vitest.expect)(new _tuple.Tuple(['1', '2']).join('')).toBe('12');
  });

  // Original test: 'tuple size'
  (0, _vitest.it)('tuple size', function () {
    var myTuple = new _tuple.Tuple([1, 2, 3, 4]);
    (0, _vitest.expect)(myTuple.size()).toBe(4);
  });

  // Original test: 'undefined tuple is empty'
  (0, _vitest.it)('undefined tuple is empty', function () {
    var t = new _tuple.Tuple();
    (0, _vitest.expect)(t.size()).toBe(0);
    t = t.append(2);
    (0, _vitest.expect)(t.value).toEqual([2]);
  });

  // Original test: 'single is returning the first element of the tuple'
  (0, _vitest.it)('single is returning the first element of the tuple', function () {
    var l = new _tuple.Tuple([1, 2]);
    (0, _vitest.expect)(l.single()).toBe(1);
  });

  // Original test: 'NEUTRAL is not added to the tuple'
  (0, _vitest.it)('NEUTRAL is not added to the tuple', function () {
    var v = _tuple.NEUTRAL;
    var vTuple = (0, _tuple.tuple)().append(_tuple.NEUTRAL);
    (0, _vitest.expect)(vTuple.size()).toBe(0);
    vTuple = vTuple.append(v).append(3).append(v).append(5);
    (0, _vitest.expect)(vTuple.size()).toBe(2);
    (0, _vitest.expect)(vTuple.array()).toEqual([3, 5]);
  });

  // Original test: 'tuple and NEUTRAL can be added in a Tuple'
  (0, _vitest.it)('tuple and NEUTRAL can be added in a Tuple', function () {
    var flat = new _tuple.Tuple([2, 4, 5]);
    var result = (0, _tuple.tuple)().append(_tuple.NEUTRAL).append(flat).append(1).append(_tuple.NEUTRAL);
    (0, _vitest.expect)(result).toEqual(new _tuple.Tuple([2, 4, 5, 1]));
  });

  // Original test: 'empty tuple append to empty tuple is an empty tuple'
  (0, _vitest.it)('empty tuple append to empty tuple is an empty tuple', function () {
    var result = (0, _tuple.tuple)().append((0, _tuple.tuple)());
    (0, _vitest.expect)(result).toEqual((0, _tuple.tuple)());
  });

  // Original test: 'last() returns the last element'
  (0, _vitest.it)('last() returns the last element', function () {
    var result = new _tuple.Tuple([2, 4, 6]).last();
    (0, _vitest.expect)(result).toBe(6);
  });

  // Original test: 'first() returns the first element'
  (0, _vitest.it)('first() returns the first element', function () {
    var result = new _tuple.Tuple([2, 4, 6]).first();
    (0, _vitest.expect)(result).toBe(2);
  });

  // Original test: 'at returns the value at index'
  (0, _vitest.it)('at returns the value at index', function () {
    var result = new _tuple.Tuple([2, 4, 6]);
    (0, _vitest.expect)(result.at(1)).toBe(4);
  });
});
//# sourceMappingURL=tuple.spec.js.map