mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-21 13:24:30 -04:00
Progress bar for Notepad IO (#1322)
This commit is contained in:
parent
0a3aa706ef
commit
411f6c0a34
3 changed files with 73 additions and 3 deletions
|
@ -435,4 +435,29 @@ SCENARIO("Delete line.") {
|
|||
}
|
||||
}
|
||||
|
||||
SCENARIO("It calls on_read_progress while reading.") {
|
||||
GIVEN("A file larger than internal buffer_size (512)") {
|
||||
std::string content = std::string(599, 'a');
|
||||
content.push_back('x');
|
||||
MockFile f{content};
|
||||
|
||||
auto w = wrap_buffer(f);
|
||||
auto init_line_count = w.line_count();
|
||||
auto init_size = w.size();
|
||||
auto called = false;
|
||||
|
||||
w.on_read_progress = [&called](auto, auto) {
|
||||
called = true;
|
||||
};
|
||||
|
||||
WHEN("Replacing range with larger size") {
|
||||
w.replace_range({0, 2}, "bbb");
|
||||
|
||||
THEN("callback should be called.") {
|
||||
CHECK(called);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_SUITE_END();
|
Loading…
Add table
Add a link
Reference in a new issue