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
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 & ÿ ü '",9 html: "asdf & ÿ ü '",10 },11 {12 input: "&",13 xml: "&#38;",14 html: "&#38;",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 "😄🍾🥳💥😇",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("�"));58 59 it("should encode surrogate pair with first surrogate equivalent of entity, without corresponding entity", () =>60 expect(entities.encodeHTML("\u{1D4A4}")).toBe("𝒤"));61});62 63describe("encodeNonAsciiHTML", () => {64 it("should encode all non-ASCII characters", () =>65 expect(entities.encodeNonAsciiHTML("<test> #123! übermaßen")).toBe(66 "<test> #123! übermaßen",67 ));68 69 it("should encode emojis", () =>70 expect(entities.encodeNonAsciiHTML("😄🍾🥳💥😇")).toBe(71 "😄🍾🥳💥😇",72 ));73 74 it("should encode chars above surrogates", () =>75 expect(entities.encodeNonAsciiHTML("♒️♓️♈️♉️♊️♋️♌️♍️♎️♏️♐️♑️")).toBe(76 "♒️♓️♈️♉️♊️♋️♌️♍️♎️♏️♐️♑️",77 ));78});79 