diff --git a/src/core/operations/Fork.mjs b/src/core/operations/Fork.mjs index 521ca271..6e961990 100644 --- a/src/core/operations/Fork.mjs +++ b/src/core/operations/Fork.mjs @@ -76,8 +76,8 @@ class Fork extends Operation { } const recipe = new Recipe(); - let output = "", - progress = 0; + const outputs = []; + let progress = 0; state.forkOffset += state.progress + 1; @@ -104,10 +104,10 @@ class Fork extends Operation { } progress = err.progress + 1; } - output += await dish.get(outputType) + mergeDelim; + outputs.push(await dish.get(outputType)); } - state.dish.set(output, outputType); + state.dish.set(outputs.join(mergeDelim), outputType); state.progress += progress; return state; } diff --git a/tests/operations/tests/Comment.mjs b/tests/operations/tests/Comment.mjs index 9fc80a63..06bf58f2 100644 --- a/tests/operations/tests/Comment.mjs +++ b/tests/operations/tests/Comment.mjs @@ -42,7 +42,7 @@ TestRegister.addTests([ { name: "Fork, Comment, Base64", input: "cat\nsat\nmat", - expectedOutput: "Y2F0\nc2F0\nbWF0\n", + expectedOutput: "Y2F0\nc2F0\nbWF0", recipeConfig: [ { "op": "Fork", diff --git a/tests/operations/tests/Fork.mjs b/tests/operations/tests/Fork.mjs index d83d6262..d7ee918c 100644 --- a/tests/operations/tests/Fork.mjs +++ b/tests/operations/tests/Fork.mjs @@ -57,7 +57,7 @@ TestRegister.addTests([ { name: "Fork, Conditional Jump, Encodings", input: "Some data with a 1 in it\nSome data with a 2 in it", - expectedOutput: "U29tZSBkYXRhIHdpdGggYSAxIGluIGl0\n53 6f 6d 65 20 64 61 74 61 20 77 69 74 68 20 61 20 32 20 69 6e 20 69 74\n", + expectedOutput: "U29tZSBkYXRhIHdpdGggYSAxIGluIGl0\n53 6f 6d 65 20 64 61 74 61 20 77 69 74 68 20 61 20 32 20 69 6e 20 69 74", recipeConfig: [ {"op": "Fork", "args": ["\\n", "\\n", false]}, {"op": "Conditional Jump", "args": ["1", false, "skipReturn", "10"]},