Skip to content

Commit

Permalink
fix prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
zyhou committed Dec 5, 2023
1 parent 16a13cb commit 009e022
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions 05/index.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@
import { Expect, Equal } from "type-testing";

import { Expect, Equal } from 'type-testing';

type SantasList<Bads extends readonly unknown[], Goods extends readonly unknown[]> = [...Bads, ...Goods];
type SantasList<
Bads extends readonly unknown[],
Goods extends readonly unknown[],
> = [...Bads, ...Goods];

// ------------------- Test section ---------------------

const bads = ['tommy', 'trash'] as const;
const goods = ['bash', 'tru'] as const;
const bads = ["tommy", "trash"] as const;
const goods = ["bash", "tru"] as const;

type test_0_actual = SantasList<typeof bads, typeof goods>;
// ^?
type test_0_expected = ['tommy', 'trash', 'bash', 'tru'];
type test_0_expected = ["tommy", "trash", "bash", "tru"];
type test_0 = Expect<Equal<test_0_actual, test_0_expected>>;

type test_1_actual = SantasList<[], []>;
// ^?
type test_1_expected = [];
type test_1 = Expect<Equal<test_1_actual, test_1_expected>>;

type test_2_actual = SantasList<[], ['trash']>;
type test_2_actual = SantasList<[], ["trash"]>;
// ^?
type test_2_expected = ['trash'];
type test_2_expected = ["trash"];
type test_2 = Expect<Equal<test_2_actual, test_2_expected>>;

type test_3_actual = SantasList<['john'], ['ashley', 'elliot', 'ziltoid']>;
type test_3_actual = SantasList<["john"], ["ashley", "elliot", "ziltoid"]>;
// ^?
type test_3_expected = ['john', 'ashley', 'elliot', 'ziltoid'];
type test_3_expected = ["john", "ashley", "elliot", "ziltoid"];
type test_3 = Expect<Equal<test_3_actual, test_3_expected>>;

type test_4_actual = SantasList<['1', 2, '3'], [false, boolean, '4', ['nested']]>;
type test_4_actual = SantasList<
["1", 2, "3"],
[false, boolean, "4", ["nested"]]
>;
// ^?
type test_4_expected = ['1', 2, '3', false, boolean, '4', ['nested']];
type test_4_expected = ["1", 2, "3", false, boolean, "4", ["nested"]];
type test_4 = Expect<Equal<test_4_actual, test_4_expected>>;

// @ts-expect-error allow only array
Expand Down

0 comments on commit 009e022

Please sign in to comment.