Title: Tests for autogenerated Kotlin getters/setters shouldn't be generated in cli and contest estimator · Issue #1338 · UnitTestBot/UTBotJava · GitHub
Open Graph Title: Tests for autogenerated Kotlin getters/setters shouldn't be generated in cli and contest estimator · Issue #1338 · UnitTestBot/UTBotJava
X Title: Tests for autogenerated Kotlin getters/setters shouldn't be generated in cli and contest estimator · Issue #1338 · UnitTestBot/UTBotJava
Description: Description We don't generate tests for autogenerated Kotlin getters/setters in plugin, we shouldn't do this in cli/contest estimator as well. To Reproduce Launch UtBot from cli for the following class: class CheckedAddition(var x: Int) ...
Open Graph Description: Description We don't generate tests for autogenerated Kotlin getters/setters in plugin, we shouldn't do this in cli/contest estimator as well. To Reproduce Launch UtBot from cli for the following c...
X Description: Description We don't generate tests for autogenerated Kotlin getters/setters in plugin, we shouldn't do this in cli/contest estimator as well. To Reproduce Launch UtBot from cli for the fol...
Opengraph URL: https://github.com/UnitTestBot/UTBotJava/issues/1338
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tests for autogenerated Kotlin getters/setters shouldn't be generated in cli and contest estimator","articleBody":"**Description**\r\n\r\nWe don't generate tests for autogenerated Kotlin getters/setters in plugin, we shouldn't do this in cli/contest estimator as well.\r\n\r\n**To Reproduce**\r\n\r\nLaunch UtBot from cli for the following class:\r\n\r\n```Kotlin\r\nclass CheckedAddition(var x: Int) {\r\n fun addWithCheck(y: Int): Int? {\r\n val res = x.toLong() + y.toLong()\r\n if (res \u003e= Int.MIN_VALUE \u0026\u0026 res \u003c= Int.MAX_VALUE) {\r\n this.x = res.toInt()\r\n return res.toInt()\r\n }\r\n return null\r\n }\r\n}\r\n```\r\n\r\n**Expected behavior**\r\n\r\nCorrect tests are generated\r\n\r\n**Actual behavior**\r\n\r\nUtBot tries to generate tests for `setX()` and `getX()` and produce incorrect tests:\r\n\r\n**Visual proofs (screenshots, logs, images)**\r\n\r\n```Kotlin\r\n@Test\r\nfun testGetX1() {\r\n val checkedAddition = CheckedAddition(1409199696)\r\n \r\n val actual = checkedAddition.getX()\r\n \r\n assertEquals(1409199696, actual)\r\n}\r\n```\r\n\r\n**Additional context**\r\n\r\nI think this should be changed in a way similar to #1192\r\n","author":{"url":"https://github.com/volivan239","@type":"Person","name":"volivan239"},"datePublished":"2022-11-09T12:57:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1338/UTBotJava/issues/1338"}
| 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:96b632a9-00fd-7e5d-cd06-f352197d51ab |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BE8C:1B0B:E5FABA:1400400:698DAEA3 |
| html-safe-nonce | 20a18aa93f57c7cb7653a989b0bec7cb51d44345a83f0ec2b65a3221a3e25ae1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRThDOjFCMEI6RTVGQUJBOjE0MDA0MDA6Njk4REFFQTMiLCJ2aXNpdG9yX2lkIjoiNTM5MTA1OTUyNTk4ODg4ODIyNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 19a64400fe6879f89f12e60e8c720b7857c7ff17f01f3f7ea16f544ced2a8d63 |
| hovercard-subject-tag | issue:1442051708 |
| 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/1338/issue_layout |
| twitter:image | https://opengraph.githubassets.com/55ddce1044f9b1edb0c1743e2577cc28705c0a0d6161c4a0930e290d1154f241/UnitTestBot/UTBotJava/issues/1338 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/55ddce1044f9b1edb0c1743e2577cc28705c0a0d6161c4a0930e290d1154f241/UnitTestBot/UTBotJava/issues/1338 |
| og:image:alt | Description We don't generate tests for autogenerated Kotlin getters/setters in plugin, we shouldn't do this in cli/contest estimator as well. To Reproduce Launch UtBot from cli for the following c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | volivan239 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8c7947c0c592efeab6162b9909ad11fa43bff8b0cb5ff43273dc25e41979d43e |
| 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 | b22a9fbf4dea601ec149a9e5362e0558df79b505 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width