blob: 9cff5962912ac2e49dec971074f960d80299e20f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#include "kernel/test_support/log_buffer.hpp"
#include <algorithm>
#include <string>
#include <vector>
namespace kernel::tests
{
auto log_buffer::append(std::string const & message) -> void
{
m_messages.push_back(message);
}
auto log_buffer::clear() -> void
{
m_messages.clear();
}
auto log_buffer::flat_messages() -> std::string
{
return std::ranges::fold_left(m_messages, std::string{}, [](std::string accumulator, std::string const & message) {
accumulator += message;
return accumulator;
});
}
auto log_buffer::messages() -> std::vector<std::string> const &
{
return m_messages;
}
} // namespace kernel::tests
|