فهرست منبع

Add quine test

ApisNecros 1 سال پیش
والد
کامیت
3d3e4231fd
1فایلهای تغییر یافته به همراه9 افزوده شده و 0 حذف شده
  1. 9 0
      tests/codebox.test.js

+ 9 - 0
tests/codebox.test.js

@@ -257,4 +257,13 @@ test("Test - factorial of ten", () => {
     });
     cb.run();
     expect(output.out).toBe("3628800");
+});
+
+test("Test - quine", () => {
+    const output = new OutputJoiner("");
+    const cb = new CodeBox(`"r00gol?!;40.`, [], {
+        outputCallback: output.push.bind(output),
+    });
+    cb.run();
+    expect(output.out).toBe('"r00gol?!;40.');
 });