We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bee6295 commit bf14972Copy full SHA for bf14972
src/language/triangle.test.ts
@@ -0,0 +1,18 @@
1
+import { triangle, triangleFor } from "./triangle.ts";
2
+import { assertEquals } from "../../deps.ts";
3
+
4
+const expected = `#
5
+##
6
+###`;
7
8
+Deno.test("[triangle]", () => {
9
+ assertEquals(triangle(), expected);
10
+});
11
12
+Deno.test("[triangleFor]", () => {
13
+ assertEquals(triangleFor(), expected);
14
15
16
+Deno.test("[triangle vs triangleFor]", () => {
17
+ assertEquals(triangle(), triangleFor());
18
src/language/triangle.ts
@@ -9,5 +9,7 @@ export function triangleFor(rows = 3) {
result += "#".repeat(i) + "\n";
}
+ result = result.slice(0, -1);
return result;
0 commit comments