-
Notifications
You must be signed in to change notification settings - Fork 2
Kf-3 add tests for basic_string #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
test/BasicStringTest.cpp
Outdated
| THEN("the string should be shrunk") | ||
| { | ||
| REQUIRE_NT_SUCCESS(status); | ||
| REQUIRE(str == "hi"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ця перевірка повинна включати інше значення, відмінне від оригінального
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
думаю, що тут скоріше була ідея, що якщо кількість символів стрінга співпадає з переданим у ресіз, то стрінга не обрізається, а зменьшується капасіті, судячи з then.
Тест з обрізанням стрінги є вище, тому цей приберу
include/kf/stl/basic_string
Outdated
|
|
||
| constexpr [[nodiscard]] NTSTATUS assign(basic_string&& other) noexcept | ||
| { | ||
| if (auto status = reallocateGrowth(other.size()); !NT_SUCCESS(status)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Яка причина цього виклику?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
прибрала
test/BasicStringTest.cpp
Outdated
| { | ||
| REQUIRE(str.data() != nullptr); | ||
| REQUIRE(ptr != nullptr); | ||
| REQUIRE(std::string_view(ptr, str.size()) == kExpected); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
оператора перетворення у string_view тут недостатньо щоб порівняти?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
спростила
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive unit tests for the basic_string class template, covering all major functionality including construction, element access, iterators, size/capacity operations, comparison, modifiers, and string operations.
- Implements comprehensive test coverage for
basic_stringclass methods - Tests both char and wchar_t template instantiations
- Covers edge cases like empty strings, out-of-bounds access, and memory allocation scenarios
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| test/CMakeLists.txt | Adds BasicStringTest.cpp to the test build configuration |
| test/BasicStringTest.cpp | Comprehensive test suite covering all basic_string functionality with 1706 lines of BDD-style tests |
| include/kf/stl/basic_string | New header implementing exception-free basic_string wrapper around std::basic_string |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
add more tests