@include test-module('Sassdash') {
  @include test('_slice') {
    $list: 1 2 3;

    @include assert-true(test-lists-equal(_slice($list, 1), 2 3),
      'should work with a positive start');

    @each $value in 3, 4, _pow(2, 32), 9999 {
      @include assert-true(test-lists-equal(_slice($list, $value), ()),
        'should work with a start >= list length');
    }

    @each $value in $test-falsey {
      @include assert-true(test-lists-equal(_slice($list, $value), $list),
        'should treat falsey start values as 0');
    }

    @include assert-true(test-lists-equal(_slice($list, -1), (3,)),
      'should work with a negative start');

    @each $value in -3, -4, -9999 {
      @include assert-true(test-lists-equal(_slice($list, $value), $list),
        'should work with a negative start <= negative list length');
    }

    @each $value in 2, 3 {
      @include assert-true(test-lists-equal(_slice($list, $value, 2), ()),
        'should work with start >= end');
    }

    @include assert-true(test-lists-equal(_slice($list, 0, 1), (1,)),
      'should work with positive end');

    @each $value in 3, 4, _pow(2, 32), 9999 {
      @include assert-true(test-lists-equal(_slice($list, 0, $value), $list),
        'should work with an end >= list length');
    }

    @each $value in $test-falsey {
      @include assert-true(test-lists-equal(_slice($list, 0, $value), ()),
        'should treat falsey end values as 0');
    }

    @include assert-true(test-lists-equal(_slice($list, 0, -1), 1 2),
      'should work with a negative end');

    @each $value in -3, -4, -9999 {
      @include assert-true(test-lists-equal(_slice($list, 0, $value), ()),
        'should work with a negative end <= negative list length');
    }

    $actual: (
      _slice($list, 0.1, 1.1),
      _slice($list, '0', 1),
      _slice($list, 0, '1'),
      _slice($list, '1'),
    );

    $expected: ((1,), (1,), (1,), (2 3));

    @include assert-true(test-lists-equal($actual, $expected),
      'should coerce start and end to integers');

    $list: ((1,), (2 3));
    $actual: _map($list, _slice);

    @include assert-true(test-lists-equal($actual, $list),
      'should work as iteratee for map');
  }
}
