@@ -34,7 +34,7 @@ constexpr uint8_t pad = 0x00;
34
34
#define BYTE_FLIPPER_READER_BYTES
35
35
#define BYTE_FLIPPER_READER_STRINGS
36
36
37
- // Exact copy of all but 2 byte_writer tests, replaced by flip::bytes::iostream.
37
+ // Exact copy of all but 2 byte_flipper tests, replaced by flip::bytes::iostream.
38
38
#define BYTE_FLIPPER_WRITER
39
39
#define BYTE_FLIPPER_WRITER_CONTEXT
40
40
#define BYTE_FLIPPER_WRITER_BIG_ENDIAN
@@ -1516,6 +1516,65 @@ BOOST_AUTO_TEST_CASE(byte_flipper__write_string_buffer__value__expected)
1516
1516
BOOST_REQUIRE (writer);
1517
1517
}
1518
1518
1519
+ // write_line
1520
+
1521
+ BOOST_AUTO_TEST_CASE (byte_flipper__write_line__default__expected)
1522
+ {
1523
+ std::stringstream stream;
1524
+ flip::bytes::iostream writer (stream);
1525
+ writer.write_line ();
1526
+ BOOST_REQUIRE_EQUAL (stream.str (), " \r\n " );
1527
+ BOOST_REQUIRE (writer);
1528
+ }
1529
+
1530
+ BOOST_AUTO_TEST_CASE (byte_flipper__write_line__empty_default__expected)
1531
+ {
1532
+ std::stringstream stream;
1533
+ flip::bytes::iostream writer (stream);
1534
+ writer.write_line (" " );
1535
+ BOOST_REQUIRE_EQUAL (stream.str (), " \r\n " );
1536
+ BOOST_REQUIRE (writer);
1537
+ }
1538
+
1539
+ BOOST_AUTO_TEST_CASE (byte_flipper__write_line__empty_empty__expected)
1540
+ {
1541
+ std::stringstream stream;
1542
+ flip::bytes::iostream writer (stream);
1543
+ writer.write_line (" " , " " );
1544
+ BOOST_REQUIRE (stream.str ().empty ());
1545
+ BOOST_REQUIRE (writer);
1546
+ }
1547
+
1548
+ BOOST_AUTO_TEST_CASE (byte_flipper__write_line__value_empty__expected)
1549
+ {
1550
+ std::stringstream stream;
1551
+ flip::bytes::iostream writer (stream);
1552
+ const std::string expected{ " abcdefghijklmnopqrstuvwxyz" };
1553
+ writer.write_line (expected, " " );
1554
+ BOOST_REQUIRE_EQUAL (stream.str (), expected);
1555
+ BOOST_REQUIRE (writer);
1556
+ }
1557
+
1558
+ BOOST_AUTO_TEST_CASE (byte_flipper__write_line__value_explicit__expected)
1559
+ {
1560
+ std::stringstream stream;
1561
+ flip::bytes::iostream writer (stream);
1562
+ const std::string expected{ " abcdefghijklmnopqrstuvwxyz" };
1563
+ writer.write_line (expected, " |" );
1564
+ BOOST_REQUIRE_EQUAL (stream.str (), expected + " |" );
1565
+ BOOST_REQUIRE (writer);
1566
+ }
1567
+
1568
+ BOOST_AUTO_TEST_CASE (byte_flipper__write_line__value_default__expected)
1569
+ {
1570
+ std::stringstream stream;
1571
+ flip::bytes::iostream writer (stream);
1572
+ const std::string expected{ " abcdefghijklmnopqrstuvwxyz" };
1573
+ writer.write_line (expected);
1574
+ BOOST_REQUIRE_EQUAL (stream.str (), expected + " \r\n " );
1575
+ BOOST_REQUIRE (writer);
1576
+ }
1577
+
1519
1578
#endif // BYTE_FLIPPER_WRITER_STRINGS
1520
1579
1521
1580
#endif // BYTE_FLIPPER_WRITER
0 commit comments