slige/surveys/code_coverage/program_2_phami_test.ts
2024-11-22 12:37:38 +01:00

11 lines
332 B
TypeScript

import { assertEquals } from "jsr:@std/assert";
import { stringToInt } from "./program_2.ts";
Deno.test("must work", () => {
assertEquals(stringToInt("0"), 0);
assertEquals(stringToInt(""), NaN);
assertEquals(stringToInt("0b10"), 2)
assertEquals(stringToInt("0x10"), 16)
assertEquals(stringToInt("010"), 8)
});