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.
ця перевірка повинна включати інше значення, відмінне від оригінального
There was a problem hiding this comment.
думаю, що тут скоріше була ідея, що якщо кількість символів стрінга співпадає з переданим у ресіз, то стрінга не обрізається, а зменьшується капасіті, судячи з 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.
Яка причина цього виклику?
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.
оператора перетворення у string_view тут недостатньо щоб порівняти?
There was a problem hiding this comment.
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