[skip ci] Update coverage.yml, add unit test for files and buffers without new line at the end of the file

This commit is contained in:
ado
2024-02-21 02:19:14 +01:00
parent 59f6591da3
commit 5e32d722e8
4 changed files with 38 additions and 5 deletions

View File

@@ -920,7 +920,6 @@ private:
}
size_t remove_eol(char*& buffer, size_t ssize) {
// TODO write unit tests
if (buffer[ssize - 1] != '\n') {
return ssize;
}
@@ -943,7 +942,6 @@ private:
buffer_size = first_size + second_size + 3;
auto new_first = static_cast<char*>(
realloc(static_cast<void*>(first), buffer_size));
// TODO check
if (!new_first) {
throw std::bad_alloc{};
}