1import { describe, expect, it } from "vite-plus/test";
2
3import { copySorted } from "./Array.ts";
4
5describe("array copies", () => {
6 it("sorts a copy without mutating the source", () => {
7 const source = [3, 1, 2];
8
9 expect(copySorted(source, (left: number, right: number) => left - right)).toEqual([1, 2, 3]);
10 expect(source).toEqual([3, 1, 2]);
11 });
12});