/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { strict as assert } from "assert";
import { normalizeFlexListLazy, normalizeFlexListEager, markEager, isLazy,
// Allow importing from this specific file which is being tested:
/* eslint-disable-next-line import/no-internal-modules */
 } from "../../../feature-libraries/typed-schema/flexList.js";
// Test ArrayHasFixedLength
{
}
// Test FlexListToNonLazyArray
{
}
// Test FlexListToLazyArray
{
}
// Test FlexListToNonLazyArray
{
}
// Test FlexListToUnion
{
}
describe("FlexList", () => {
    it("correctly normalizes lists to be lazy", () => {
        const list = [2, () => 1];
        const normalized = normalizeFlexListLazy(list);
        assert(normalized.length === 2);
        const data = normalized.map((f) => f());
        assert.deepEqual(data, [2, 1]);
    });
    it("correctly normalizes lists to be eager", () => {
        const list = [2, () => 1];
        const normalized = normalizeFlexListEager(list);
        assert.deepEqual(normalized, [2, 1]);
    });
    it("can mark functions as eager", () => {
        const fn = () => 42;
        assert.equal(isLazy(fn), true);
        markEager(fn);
        assert.equal(isLazy(fn), false);
    });
    it("correctly normalizes functions marked as eager", () => {
        const eagerGenerator = markEager(() => 42);
        const lazyGenerator = () => () => 42;
        const list = [eagerGenerator, lazyGenerator];
        normalizeFlexListEager(list).forEach((g) => assert.equal(g(), 42));
        normalizeFlexListLazy(list).forEach((g) => assert.equal(g()(), 42));
    });
});
//# sourceMappingURL=flexList.spec.js.map