deno.land / x / masx200_leetcode_test@10.6.5 / solve-the-equation / test.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { assertEquals } from "https://deno.land/std@0.157.0/testing/asserts.ts";
import solveEquation from "./index.ts";
Deno.test("solve-the-equation", () => { const inputs = [ "12x=99x", "x+5-3+x=6+x-2", "x=x", "2x=x", "-x=-1", "2x+3x-6x=x+2", "12=99", ]; const outputs = [ "x=0", "x=2", "Infinite solutions", "x=0", "x=1", "x=-1", "No solution", ]; assertEquals(inputs.map((input) => solveEquation(input)), outputs);});
masx200_leetcode_test

Version Info

Tagged at
a year ago