Team Ai
Datasetpublic

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.

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes3.1kdownloads
encode.spec.ts79 linesDownload Raw Back to src
1import { describe, it, expect } from "vitest";2import * as entities from "./index.js";3 4describe("Encode->decode test", () => {5    const testcases = [6        {7            input: "asdf & ÿ ü '",8            xml: "asdf &amp; &#xff; &#xfc; &apos;",9            html: "asdf &amp; &yuml; &uuml; &apos;",10        },11        {12            input: "&#38;",13            xml: "&amp;#38;",14            html: "&amp;&num;38&semi;",15        },16    ];17 18    for (const { input, xml, html } of testcases) {19        const encodedXML = entities.encodeXML(input);20        it(`should XML encode ${input}`, () => expect(encodedXML).toBe(xml));21        it(`should default to XML encode ${input}`, () =>22            expect(entities.encode(input)).toBe(xml));23        it(`should XML decode ${encodedXML}`, () =>24            expect(entities.decodeXML(encodedXML)).toBe(input));25        it(`should default to XML encode ${encodedXML}`, () =>26            expect(entities.decode(encodedXML)).toBe(input));27        it(`should default strict to XML encode ${encodedXML}`, () =>28            expect(entities.decodeStrict(encodedXML)).toBe(input));29 30        const encodedHTML5 = entities.encodeHTML5(input);31        it(`should HTML5 encode ${input}`, () =>32            expect(encodedHTML5).toBe(html));33        it(`should HTML5 decode ${encodedHTML5}`, () =>34            expect(entities.decodeHTML(encodedHTML5)).toBe(input));35        it("should encode emojis", () =>36            expect(entities.encodeHTML5("😄🍾🥳💥😇")).toBe(37                "&#x1f604;&#x1f37e;&#x1f973;&#x1f4a5;&#x1f607;",38            ));39    }40 41    it("should encode data URIs (issue #16)", () => {42        const data =43            "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAALAAABAAEAAAIBRAA7";44        expect(entities.decode(entities.encode(data))).toBe(data);45    });46 47    it("should HTML encode all ASCII characters", () => {48        for (let index = 0; index < 128; index++) {49            const char = String.fromCharCode(index);50            const encoded = entities.encodeHTML(char);51            const decoded = entities.decodeHTML(encoded);52            expect(decoded).toBe(char);53        }54    });55 56    it("should encode trailing parts of entities", () =>57        expect(entities.encodeHTML("\uD835")).toBe("&#xd835;"));58 59    it("should encode surrogate pair with first surrogate equivalent of entity, without corresponding entity", () =>60        expect(entities.encodeHTML("\u{1D4A4}")).toBe("&#x1d4a4;"));61});62 63describe("encodeNonAsciiHTML", () => {64    it("should encode all non-ASCII characters", () =>65        expect(entities.encodeNonAsciiHTML("<test> #123! übermaßen")).toBe(66            "&lt;test&gt; #123! &uuml;berma&szlig;en",67        ));68 69    it("should encode emojis", () =>70        expect(entities.encodeNonAsciiHTML("😄🍾🥳💥😇")).toBe(71            "&#x1f604;&#x1f37e;&#x1f973;&#x1f4a5;&#x1f607;",72        ));73 74    it("should encode chars above surrogates", () =>75        expect(entities.encodeNonAsciiHTML("♒️♓️♈️♉️♊️♋️♌️♍️♎️♏️♐️♑️")).toBe(76            "&#x2652;&#xfe0f;&#x2653;&#xfe0f;&#x2648;&#xfe0f;&#x2649;&#xfe0f;&#x264a;&#xfe0f;&#x264b;&#xfe0f;&#x264c;&#xfe0f;&#x264d;&#xfe0f;&#x264e;&#xfe0f;&#x264f;&#xfe0f;&#x2650;&#xfe0f;&#x2651;&#xfe0f;",77        ));78});79 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai