Kaynağa Gözat

Add factorial test

ApisNecros 1 yıl önce
ebeveyn
işleme
89a015c12d
1 değiştirilmiş dosya ile 10 ekleme ve 0 silme
  1. 10 0
      tests/codebox.test.js

+ 10 - 0
tests/codebox.test.js

@@ -247,4 +247,14 @@ v"It works!"
     });
     cb.run();
     expect(output.out).toBe("It works!");
+});
+
+test("Test - factorial of ten", () => {
+    const output = new OutputJoiner("");
+    const cb = new CodeBox(` :?\\~11>*l1\\
+-1:/ ;n\\?- /`, [10], {
+        outputCallback: output.push.bind(output),
+    });
+    cb.run();
+    expect(output.out).toBe("3628800");
 });