leetcode-cli icon indicating copy to clipboard operation
leetcode-cli copied to clipboard

[Feature Request] Print new line in stdout of "test" command

Open xjj59307 opened this issue 6 years ago • 2 comments

test command doesn't interpret '\n' characters in stdout like follows.

> leetcode test solution.java

Input data:
[7,2,5,10,8]
2

Actual
  ✘ Runtime Error
  ✘ runtime: N/A
  ✘ answer:
  ✘ stdout: 'low:16\nhigh:32'
  ✘ error: Line 14: java.lang.ArrayIndexOutOfBoundsException: -1

stdout is very useful when debugging while all logs being printed in a single line is pretty hard to understand. Is it possible to print a new line for each '\n' in stdout?

xjj59307 avatar May 01 '19 06:05 xjj59307

same problem

edte avatar Jul 11 '22 09:07 edte

I tried modifying the config file without success, but after querying google, I am now temporarily using the awk command to replace \n

like

lc test 1252.cells-with-odd-values-in-a-matrix.cpp | awk '{gsub(/\\n/,"\n")}1'  

edte avatar Jul 12 '22 09:07 edte