Title: Stacktraces in comments should be escaped · Issue #609 · UnitTestBot/UTBotJava · GitHub
Open Graph Title: Stacktraces in comments should be escaped · Issue #609 · UnitTestBot/UTBotJava
X Title: Stacktraces in comments should be escaped · Issue #609 · UnitTestBot/UTBotJava
Description: Description Example: There are hundreds of error messages in the UTBot log. Looks like the problem is in the concrete executor. To Reproduce Try to generate tests for the following method: public int error(String s) { if (s.length() == 3...
Open Graph Description: Description Example: There are hundreds of error messages in the UTBot log. Looks like the problem is in the concrete executor. To Reproduce Try to generate tests for the following method: public i...
X Description: Description Example: There are hundreds of error messages in the UTBot log. Looks like the problem is in the concrete executor. To Reproduce Try to generate tests for the following method: public i...
Opengraph URL: https://github.com/UnitTestBot/UTBotJava/issues/609
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Stacktraces in comments should be escaped","articleBody":"**Description**\r\n\r\n_Example:_ There are hundreds of error messages in the UTBot log. Looks like the problem is in the concrete executor.\r\n\r\n**To Reproduce**\r\nTry to generate tests for the following method:\r\n```\r\n public int error(String s) {\r\n if (s.length() == 3 \u0026\u0026 !\" \".equals(s)) {\r\n return Integer.parseInt(s);\r\n }\r\n return -1;\r\n }\r\n```\r\nGenerated test should looks like this:\r\n```\r\n @Test\r\n @DisplayName(\"error: s has special characters -\u003e throw NumberFormatException\")\r\n public void testErrorThrowsNFEWithBlankString() {\r\n A a = new A();\r\n \r\n /* This test fails because method [hello.A.error] produces [java.lang.NumberFormatException: For input string: \"\r\nHERE COME SEPARATORS THAT BREAK Document in IDEA\t\r\n\"]\r\n java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)\r\n java.lang.Integer.parseInt(Integer.java:569)\r\n java.lang.Integer.parseInt(Integer.java:615)\r\n hello.A.error(A.java:11) */\r\n a.error(\"\\n\\t\\r\");\r\n }\r\n\r\n```\r\nbut it fails.\r\n```\r\njava.lang.AssertionError: Wrong line separators: '...tring: \\\"\\n\\t\\r\\\"]\\n ...' at offset 547\r\n\tat com.intellij.openapi.util.text.StringUtil.assertValidSeparators(StringUtil.java:2450)\r\n\tat com.intellij.openapi.editor.impl.DocumentImpl.assertValidSeparators(DocumentImpl.java:690)\r\n\tat com.intellij.openapi.editor.impl.DocumentImpl.replaceString(DocumentImpl.java:599)\r\n\tat com.intellij.openapi.editor.impl.DocumentImpl.lambda$setText$2(DocumentImpl.java:1061)\r\n\tat com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:211)\r\n\tat com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:177)\r\n\tat com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:167)\r\n\tat com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:153)\r\n\tat com.intellij.openapi.editor.impl.DocumentImpl.setText(DocumentImpl.java:1066)\r\n\tat org.utbot.intellij.plugin.generator.CodeGenerationController$generateCodeAndReport$1$1$1$$special$$inlined$executeCommand$1.run(actions.kt:13)\r\n\tat com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:220)\r\n\tat com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:177)\r\n\tat com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:167)\r\n\tat com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:153)\r\n\tat org.utbot.intellij.plugin.generator.CodeGenerationController$generateCodeAndReport$1$1$1.run(CodeGenerationController.kt:590)\r\n```\r\n\r\n**Expected behavior**\r\n\\n\\t\\r should be escaped in a comment\r\n\r\n**Actual behavior**\r\nWe get empty test class\r\n","author":{"url":"https://github.com/Vassiliy-Kudryashov","@type":"Person","name":"Vassiliy-Kudryashov"},"datePublished":"2022-07-29T09:05:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/609/UTBotJava/issues/609"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fcd52ce5-41e4-be2e-bc8f-6270d91f58f6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CEC0:C4F19:1175E1C:161A000:69902BD1 |
| html-safe-nonce | d877d151e310ba5d4405e09615c6b5f8e725246cbe78f7c12c51c4b9c1fa7410 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUMwOkM0RjE5OjExNzVFMUM6MTYxQTAwMDo2OTkwMkJEMSIsInZpc2l0b3JfaWQiOiI5MjExMjU4NjQxNzEzMjEyMzY5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a8a36784cf0fd25227ba9c8d4b8641deab1eb5e5d84f979521589af5f1157fd0 |
| hovercard-subject-tag | issue:1321965814 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/UnitTestBot/UTBotJava/609/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8ae432fa423f708a3723cfceb59e03fe793cf968b8b34cd4812e1b55658cde50/UnitTestBot/UTBotJava/issues/609 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8ae432fa423f708a3723cfceb59e03fe793cf968b8b34cd4812e1b55658cde50/UnitTestBot/UTBotJava/issues/609 |
| og:image:alt | Description Example: There are hundreds of error messages in the UTBot log. Looks like the problem is in the concrete executor. To Reproduce Try to generate tests for the following method: public i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Vassiliy-Kudryashov |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/UnitTestBot/UTBotJava git https://github.com/UnitTestBot/UTBotJava.git |
| octolytics-dimension-user_id | 87413538 |
| octolytics-dimension-user_login | UnitTestBot |
| octolytics-dimension-repository_id | 480810501 |
| octolytics-dimension-repository_nwo | UnitTestBot/UTBotJava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 480810501 |
| octolytics-dimension-repository_network_root_nwo | UnitTestBot/UTBotJava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width