@use 'px' as *;
@use 'true' as *;

@include test-module('utils.collections') {
    @include test('map-get-default') {
        @include assert-equal(
            map-get-default(
                (
                    a: 1,
                    b: 2,
                ),
                a,
                3
            ),
            1
        );
    }
    @include test('map-deep-get') {
        @include assert-equal(
            map-deep-get(
                (
                    a: 1,
                    b: 2,
                ),
                b
            ),
            2
        );
    }
    @include test('nth-or-val') {
        @include assert-equal(nth-or-val((a, b, c), 1, d), a);
    }
    @include test('list-remove') {
        @include assert-equal(list-remove((a, b, c), 1), (b, c));
    }
    // Robby: not sure this is working properly
    @include test('list-replace') {
        @include assert-equal(
            list-replace(
                (a, 1, c, d, e),
                (
                    e: 7,
                )
            ),
            (a 1 c d 7)
        );
    }
    @include test('list-contains') {
        @include assert-equal(list-contains((a, b, c), c), true);
    }
    @include test('list-sort-num') {
        @include assert-equal(list-sort-num((2, 4, 1, 5, 3)), (1 2 3 4 5));
    }
    //need help
    // @include test('list-sort') {
    //     @include assert-equal(list-sort(('z', 'a')), ('z a'));
    // }
    //map-sort-by-values: need help

    //need help - "mixins may not contain function declarations"
    // @include test('list-map') {
    //     @function square($x, $i) {
    //         @return $x * $x;
    //     }
    //     @include assert-equal(list-map((1 2 3 4), square), 1 4 9 16);
    // }
    //need help
    //map-collect
}
