| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -127,7 +127,7 @@ public static void reportDone(final String invokeid, final byte[] result, final | |||
| 127 | 127 | "Max Memory Used: " + maxMemory + " MB", | |
| 128 | 128 | "")); | |
| 129 | 129 | if (result != null) { | |
| 130 | - System.out.println(new String(result, 0, resultLength)); | ||
| 130 | + System.out.println("\n" + new String(result, 0, resultLength)); | ||
| 131 | 131 | } | |
| 132 | 132 | } | |
| 133 | 133 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ function systemErr(str) { | |||
| 26 | 26 | } | |
| 27 | 27 | ||
| 28 | 28 | function handleResult(resultStr, cb) { | |
| 29 | - if (!process.stdout.write(resultStr)) { | ||
| 29 | + if (!process.stdout.write('\n' + resultStr + '\n')) { | ||
| 30 | 30 | process.stdout.once('drain', cb) | |
| 31 | 31 | } else { | |
| 32 | 32 | process.nextTick(cb) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ function systemErr(str) { | |||
| 26 | 26 | } | |
| 27 | 27 | ||
| 28 | 28 | function handleResult(resultStr, cb) { | |
| 29 | - if (!process.stdout.write(resultStr)) { | ||
| 29 | + if (!process.stdout.write('\n' + resultStr + '\n')) { | ||
| 30 | 30 | process.stdout.once('drain', cb) | |
| 31 | 31 | } else { | |
| 32 | 32 | process.nextTick(cb) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ function systemErr(str) { | |||
| 26 | 26 | } | |
| 27 | 27 | ||
| 28 | 28 | function handleResult(resultStr, cb) { | |
| 29 | - if (!process.stdout.write(resultStr)) { | ||
| 29 | + if (!process.stdout.write('\n' + resultStr + '\n')) { | ||
| 30 | 30 | process.stdout.once('drain', cb) | |
| 31 | 31 | } else { | |
| 32 | 32 | process.nextTick(cb) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -149,7 +149,7 @@ def report_done(invokeid, errortype, result): | |||
| 149 | 149 | ) | |
| 150 | 150 | ) | |
| 151 | 151 | if result: | |
| 152 | - print(result, file=orig_stdout) | ||
| 152 | + print('\n' + result, file=orig_stdout) | ||
| 153 | 153 | sys.exit(1 if _GLOBAL_ERRORED else 0) | |
| 154 | 154 | else: | |
| 155 | 155 | return | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -149,7 +149,7 @@ def report_done(invokeid, errortype, result): | |||
| 149 | 149 | ) | |
| 150 | 150 | ) | |
| 151 | 151 | if result: | |
| 152 | - print(result, file=orig_stdout) | ||
| 152 | + print('\n' + result, file=orig_stdout) | ||
| 153 | 153 | sys.exit(1 if _GLOBAL_ERRORED else 0) | |
| 154 | 154 | else: | |
| 155 | 155 | return | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -81,6 +81,11 @@ resetMock({status: 0, stdout: 'Test\nResult\n{"success":true}'}) | |||
| 81 | 81 | result = dockerLambda() | |
| 82 | 82 | result.should.eql({success: true}) | |
| 83 | 83 | ||
| 84 | + // Should not fail if stdout contains extra newlines | ||
| 85 | + resetMock({status: 0, stdout: 'Test\nResult\n\n{"success":true}\n\n'}) | ||
| 86 | + result = dockerLambda() | ||
| 87 | + result.should.eql({success: true}) | ||
| 88 | + | ||
| 84 | 89 | // Should return undefined if last stdout entry cannot be parsed | |
| 85 | 90 | resetMock({status: 0, stdout: 'Test\nResult\nsuccess'}) | |
| 86 | 91 | result = dockerLambda() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments