Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/cliffy/table/test/utils_test.ts

Command line framework for deno πŸ¦• Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Extremely Popular
Go to Latest
File
import { consumeWords } from "../utils.ts";import { assertEquals } from "../../dev_deps.ts";
const str = "β”‚cell1β”‚cell2 cell2 cell2 cell2 cell2 cell2 cell2 cell2 cell2 cell2β”‚cell3β”‚";
Deno.test("consume words 01", () => { assertEquals(consumeWords(str.length, str), str);});
Deno.test("consume words 02", () => { assertEquals( consumeWords(str.length - 1, str), "β”‚cell1β”‚cell2 cell2 cell2 cell2 cell2 cell2 cell2 cell2 cell2", );});
Deno.test("consume words 03", () => { assertEquals(consumeWords(5, str), "β”‚cell1β”‚cell2");});
Deno.test("consume words 04", () => { assertEquals(consumeWords(12, str), "β”‚cell1β”‚cell2");});
Deno.test("consume words 05", () => { assertEquals(consumeWords(17, str), "β”‚cell1β”‚cell2");});
Deno.test("consume words 06", () => { assertEquals(consumeWords(18, str), "β”‚cell1β”‚cell2 cell2");});
Deno.test("consume words 07", () => { assertEquals(consumeWords(19, str), "β”‚cell1β”‚cell2 cell2");});
Deno.test("consume words 08", () => { assertEquals(consumeWords(19, ` ${str} `), " β”‚cell1β”‚cell2");});
Deno.test("consume words 09", () => { assertEquals(consumeWords(20, ` ${str} `), " β”‚cell1β”‚cell2 cell2");});
Deno.test("consume words 10", () => { assertEquals(consumeWords(21, ` ${str} `), " β”‚cell1β”‚cell2 cell2");});
Deno.test("consume words 11", () => { assertEquals(consumeWords(22, ` ${str} `), " β”‚cell1β”‚cell2 cell2");});
const multilineStr = ` β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β” β”‚cell1β”‚cell2 cell2 cell2 cell2 cell2 cell2 cell2 cell2 cell2 cell2β”‚cell3β”‚ β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€ β”‚cell1β”‚cell2 β”‚cell3β”‚ β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€ β”‚cell1β”‚cell2 β”‚cell3β”‚ β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”˜`;
Deno.test("consume words 12", () => { assertEquals( consumeWords(74, multilineStr.slice(1)), " β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”", );});