mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:17:35 +00:00
AK: Move memory streams from LibCore
This commit is contained in:
parent
11550f582b
commit
093cf428a3
46 changed files with 213 additions and 203 deletions
|
@ -7,7 +7,7 @@
|
|||
#include <LibTest/TestCase.h>
|
||||
|
||||
#include "../CSV.h"
|
||||
#include <LibCore/MemoryStream.h>
|
||||
#include <AK/MemoryStream.h>
|
||||
|
||||
TEST_CASE(can_write)
|
||||
{
|
||||
|
@ -17,7 +17,7 @@ TEST_CASE(can_write)
|
|||
{ 7, 8, 9 },
|
||||
};
|
||||
|
||||
Core::Stream::AllocatingMemoryStream stream;
|
||||
AllocatingMemoryStream stream;
|
||||
MUST(Writer::CSV::generate(stream, data));
|
||||
|
||||
auto expected_output = R"~(1,2,3
|
||||
|
@ -37,7 +37,7 @@ TEST_CASE(can_write_with_header)
|
|||
{ 7, 8, 9 },
|
||||
};
|
||||
|
||||
Core::Stream::AllocatingMemoryStream stream;
|
||||
AllocatingMemoryStream stream;
|
||||
MUST(Writer::CSV::generate(stream, data, { "A"sv, "B\""sv, "C"sv }));
|
||||
|
||||
auto expected_output = R"~(A,"B""",C
|
||||
|
@ -57,7 +57,7 @@ TEST_CASE(can_write_with_different_behaviors)
|
|||
{ "We\"ll", "Hello,", " Friends" },
|
||||
};
|
||||
|
||||
Core::Stream::AllocatingMemoryStream stream;
|
||||
AllocatingMemoryStream stream;
|
||||
MUST(Writer::CSV::generate(stream, data, { "A"sv, "B\""sv, "C"sv }, Writer::WriterBehavior::QuoteOnlyInFieldStart | Writer::WriterBehavior::WriteHeaders));
|
||||
|
||||
auto expected_output = R"~(A,B",C
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue