Parsing error, if `<` or `>` is printed to console
See original GitHub issueChecklist
- The issue is about this extension and NOT about a fork.
- Check the known issues list.
- The latest version of the extension was used.
- It is not related to remote-vscode or I checked the following issue
Describe the bug
Having text with angle brackets <
, >
causes parsing error. The log of the error is attached below along with a small program to reproduce the bug.
To Reproduce
#include <catch.hpp>
#include <iostream>
TEST_CASE("Parsing Bug: Print") { std::cout << "<Hello>"; }
TEST_CASE("Parsing Bug: spdlog") { SPDLOG_DEBUG("Hello"); }
TEST_CASE("Parsing Bug: spdlog <>") { SPDLOG_DEBUG("<Hello>"); }
Screenshots (optional)
Desktop
- Extension Version: 3.6.7
- VS Code Version: 1.51.1
- Catch2 / Google Test / DOCTest Version: 2.13.3
- OS Type and Version: Ubuntu 20.04.1 LTS
- Using remote-ssh/docker/wsl?: No
Regression bug?
- Last extension version in which the feature were working:
Log (optional but recommended)
😱 Unexpected error under parsing output !! Error: Error: Error: Unexpected close tag
Line: 3
Column: 15
Char: >
at k (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:238811)
at A (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:239187)
at j (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:241565)
at i.write (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:231144)
at i.parseString (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:392173)
at i.parseString (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:386744)
at h.parseAndProcessTestCase (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:335697)
at u (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:329970)
at Socket.<anonymous> (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:332007)
at Socket.emit (events.js:223:5)
at Socket.EventEmitter.emit (domain.js:475:20)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:290:11)
at Socket.Readable.push (_stream_readable.js:224:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:181:23)
at /home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:335731
at i.<anonymous> (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:391992)
at i.emit (events.js:223:5)
at i.EventEmitter.emit (domain.js:475:20)
at i.saxParser.onerror (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:388816)
at T (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:238475)
at k (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:238834)
at A (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:239187)
at j (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:241565)
at i.write (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:231144)
at i.parseString (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:392173)
at i.parseString (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:386744)
at h.parseAndProcessTestCase (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:335697)
at u (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:329970)
at Socket.<anonymous> (/home/home/.vscode/extensions/matepek.vscode-catch2-test-adapter-3.6.7/out/dist/main.js:2:332007)
at Socket.emit (events.js:223:5)
at Socket.EventEmitter.emit (domain.js:475:20)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:290:11)
at Socket.Readable.push (_stream_readable.js:224:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:181:23)
Consider opening an issue: https://github.com/matepek/vscode-catch2-test-adapter/issues/new/choose
Please attach the output of: "/home/home/Documents/Cpp-Things/Microfabricator-Embedded/build/test/firmware_test /home/home/Documents/Cpp-Things/Microfabricator-Embedded/build/test/firmware_test,LightSensor: can Construct.,LightSensor: can set Pin.,LightSensor: can read Value.,LightSensor: transmits correctly.,Light Controller: can construct.,--reporter,xml,--durations,yes"
⬇ std::cout:
[object Object]
⬆ std::cout
⬇ stdoutBuffer:
<TestCase name="LightSensor: can Construct." filename="/home/home/Documents/Cpp-Things/Microfabricator-Embedded/test/unit-tests/light_sensor_test.cpp" line="7">
[132357μs] 12 D FakeLightSensor.hpp Constructed <Pin:10>
<OverallResult success="true" durationInSeconds="4.3e-05"/>
</TestCase>
<TestCase name="LightSensor: can set Pin." filename="/home/home/Documents/Cpp-Things/Microfabricator-Embedded/test/unit-tests/light_sensor_test.cpp" line="13">
[132401μs] 12 D FakeLightSensor.hpp Constructed <Pin:10>
<OverallResult success="true" durationInSeconds="1.6e-05"/>
</TestCase>
<TestCase name="LightSensor: can read Value." filename="/home/home/Documents/Cpp-Things/Microfabricator-Embedded/test/unit-tests/light_sensor_test.cpp" line="19">
[132427μs] 12 D FakeLightSensor.hpp Constructed <Pin:10>
<OverallResult success="true" durationInSeconds="9.7e-05"/>
</TestCase>
<TestCase name="LightSensor: transmits correctly." filename="/home/home/Documents/Cpp-Things/Microfabricator-Embedded/test/unit-tests/light_sensor_test.cpp" line="29">
[132538μs] 12 D FakeLightSensor.hpp Constructed <Pin:10>
⬆ stdoutBuffer
⬇ std::cerr:
[object Object]
⬆ std::cerr
⬇ stderrBuffer:
⬆ stderrBuffer
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
JSON Parse Printing to Console but errors if called anywhere ...
So I have this function which runs whenever the client gets a message from the server it is connected to through websocket:
Read more >Why to use console.error instead of console.log to print results
Hi, I would like to know why are you using console.error instead of console.log to print all the results. function printResults(results) ...
Read more >SyntaxError: unexpected EOF while parsing - STechies
It can be due to some incomplete syntax, i.e., something missing in the code which terminated further execution of the program. While debugging...
Read more >Code not working. Node returns no errors, but doesn't print out ...
Node returns no errors, but doesn't print out any console logs written within the function get(query). I've added additional console logs to ...
Read more >Unparsable structured data report - Search Console Help
Error types ; Unable to parse token length, For some reason the start and end of a property or value could not be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well in the perspective of this extension: The Catch2 library emits xml output which is not parsable.
What I’m trying to say is that Catch2 is smart and I would expect that it handles it well. (As it does actually in case of
std::cout << "<Hello>";
). The problem is might related tyo SPDLOG which uses a different way of writing the output and Catch2 cannot capture and escape that.Thank you for a very useful extension. 👏