Title: General test setup · Issue #12 · taskolib/libgit4cpp · GitHub
Open Graph Title: General test setup · Issue #12 · taskolib/libgit4cpp
X Title: General test setup · Issue #12 · taskolib/libgit4cpp
Description: The tests in test_GitRepository.cc are written in this way: TEST_CASE("GitRepository Wrapper Test all", "[GitWrapper]") { SECTION("Construct GitRepository object") { ... } SECTION("Stage files") { // add some files to the index (`git add...
Open Graph Description: The tests in test_GitRepository.cc are written in this way: TEST_CASE("GitRepository Wrapper Test all", "[GitWrapper]") { SECTION("Construct GitRepository object") { ... } SECTION("Stage files") { ...
X Description: The tests in test_GitRepository.cc are written in this way: TEST_CASE("GitRepository Wrapper Test all", "[GitWrapper]") { SECTION("Construct GitRepository object") { ....
Opengraph URL: https://github.com/taskolib/libgit4cpp/issues/12
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"General test setup","articleBody":"The tests in `test_GitRepository.cc` are written in this way:\r\n\r\n```c++\r\nTEST_CASE(\"GitRepository Wrapper Test all\", \"[GitWrapper]\")\r\n{\r\n SECTION(\"Construct GitRepository object\")\r\n {\r\n ...\r\n }\r\n SECTION(\"Stage files\")\r\n {\r\n // add some files to the index (`git add`)\r\n // and check the index directly\r\n ...\r\n } \r\n SECTION(\"Commit\")\r\n {\r\n // commit any changes that are staged\r\n // and check the index directly\r\n ...\r\n }\r\n```\r\n\r\nThe tests in the 3rd section and only ever succeed when the 2nd section did it works.\r\nFurthermore the scope above the first section is empty.\r\n\r\nIn catch2, sections are most useful when there is code before the first section, because that is done before every section. The resulting code is not what it looks like. Take this example\r\n\r\n```c++\r\nTEST_CASE(\"test\", \"test\")\r\n{\r\n int i = 3;\r\n SECTION(\"do something\")\r\n {\r\n REQUIRE(i == 3);\r\n i = 5;\r\n }\r\n SECTION(\"do something other\")\r\n {\r\n ++i;\r\n REQUIRE(i == 4);\r\n }\r\n}\r\n```\r\n_All tests succeed!_\r\n\r\nFurthermore when one section fails the other sections are still executed as they are intended to be no depending one on another.\r\n\r\nFor this we should just throw out all the `SECTION` markers. If you want to add some comments that only show on fails use `INFO` or equivalents.","author":{"url":"https://github.com/Finii","@type":"Person","name":"Finii"},"datePublished":"2023-12-04T19:18:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/12/libgit4cpp/issues/12"}
| 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:9d157bfb-f2d0-10cc-36f9-924af1983241 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8834:81A5B:8B3FCB:B2841C:699282CC |
| html-safe-nonce | 00967eb80fd4616650f6428ea9584fff763d5f30f9425bd01a42073c50596d50 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODM0OjgxQTVCOjhCM0ZDQjpCMjg0MUM6Njk5MjgyQ0MiLCJ2aXNpdG9yX2lkIjoiODgyNDMzMjA5NDY0Nzk5MzAzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7f3d1e456c80b19c0379a1602340d94d6c11d38ee50cf9d3e4fd70521c06a1f3 |
| hovercard-subject-tag | issue:2024546483 |
| 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/taskolib/libgit4cpp/12/issue_layout |
| twitter:image | https://opengraph.githubassets.com/86515be85578b8dd604bb845e337016d940cc70476b44a02f9f815be9200d7cb/taskolib/libgit4cpp/issues/12 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/86515be85578b8dd604bb845e337016d940cc70476b44a02f9f815be9200d7cb/taskolib/libgit4cpp/issues/12 |
| og:image:alt | The tests in test_GitRepository.cc are written in this way: TEST_CASE("GitRepository Wrapper Test all", "[GitWrapper]") { SECTION("Construct GitRepository object") { ... } SECTION("Stage files") { ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Finii |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/taskolib/libgit4cpp git https://github.com/taskolib/libgit4cpp.git |
| octolytics-dimension-user_id | 112690961 |
| octolytics-dimension-user_login | taskolib |
| octolytics-dimension-repository_id | 648659767 |
| octolytics-dimension-repository_nwo | taskolib/libgit4cpp |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 648659767 |
| octolytics-dimension-repository_network_root_nwo | taskolib/libgit4cpp |
| 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 | 848bc6032dcc93a9a7301dcc3f379a72ba13b96e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width