Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1// @ts-ignore TS61332import { expect, test } from "vitest";3 4import * as z from "zod/v3";5 6test("function parsing", () => {7 const schema = z.union([z.string().refine(() => false), z.number().refine(() => false)]);8 const result = schema.safeParse("asdf");9 expect(result.success).toEqual(false);10});11 12test("union 2", () => {13 const result = z.union([z.number(), z.string().refine(() => false)]).safeParse("a");14 expect(result.success).toEqual(false);15});16 17test("return valid over invalid", () => {18 const schema = z.union([19 z.object({20 email: z.string().email(),21 }),22 z.string(),23 ]);24 expect(schema.parse("asdf")).toEqual("asdf");25 expect(schema.parse({ email: "asdlkjf@lkajsdf.com" })).toEqual({26 email: "asdlkjf@lkajsdf.com",27 });28});29 30test("return dirty result over aborted", () => {31 const result = z.union([z.number(), z.string().refine(() => false)]).safeParse("a");32 expect(result.success).toEqual(false);33 if (!result.success) {34 expect(result.error.issues).toEqual([35 {36 code: "custom",37 message: "Invalid input",38 path: [],39 },40 ]);41 }42});43 44test("options getter", async () => {45 const union = z.union([z.string(), z.number()]);46 union.options[0].parse("asdf");47 union.options[1].parse(1234);48 await union.options[0].parseAsync("asdf");49 await union.options[1].parseAsync(1234);50});51 52test("readonly union", async () => {53 const options = [z.string(), z.number()] as const;54 const union = z.union(options);55 union.parse("asdf");56 union.parse(12);57});58 