slige/surveys/code_coverage/program_2_phami_test.ts

11 lines
332 B
TypeScript
Raw Normal View History

2024-11-22 11:37:38 +00:00
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)
});