瀏覽代碼

Merge branch 'master' of https://github.com/pH-T/CyberChef into pH-T-master

n1474335 3 年之前
父節點
當前提交
18022a2a48
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 1 1
      src/core/operations/GetAllCasings.mjs
  2. 3 3
      tests/operations/tests/GetAllCasings.mjs

+ 1 - 1
src/core/operations/GetAllCasings.mjs

@@ -46,7 +46,7 @@ class GetAllCasings extends Operation {
             }
             result += temp.join("") + "\n";
         }
-        return result;
+        return result.slice(0, -1);
     }
 }
 

+ 3 - 3
tests/operations/tests/GetAllCasings.mjs

@@ -11,7 +11,7 @@ TestRegister.addTests([
     {
         name: "All casings of test",
         input: "test",
-        expectedOutput: "test\nTest\ntEst\nTEst\nteSt\nTeSt\ntESt\nTESt\ntesT\nTesT\ntEsT\nTEsT\nteST\nTeST\ntEST\nTEST\n",
+        expectedOutput: "test\nTest\ntEst\nTEst\nteSt\nTeSt\ntESt\nTESt\ntesT\nTesT\ntEsT\nTEsT\nteST\nTeST\ntEST\nTEST",
         recipeConfig: [
             {
                 "op": "Get All Casings",
@@ -22,7 +22,7 @@ TestRegister.addTests([
     {
         name: "All casings of t",
         input: "t",
-        expectedOutput: "t\nT\n",
+        expectedOutput: "t\nT",
         recipeConfig: [
             {
                 "op": "Get All Casings",
@@ -33,7 +33,7 @@ TestRegister.addTests([
     {
         name: "All casings of null",
         input: "",
-        expectedOutput: "\n",
+        expectedOutput: "",
         recipeConfig: [
             {
                 "op": "Get All Casings",