This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start work on constructing Text from a byte stream
Signed-off-by: Nathan Sobo <[email protected]>
- Loading branch information
1 parent
b41fc78
commit 0bbafab
Showing
4 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "test-helpers.h" | ||
#include <sstream> | ||
#include "text.h" | ||
|
||
using std::stringstream; | ||
|
||
TEST_CASE("builds a Text from a UTF8 stream") { | ||
stringstream stream("abcdefg\nhijklmnop", std::ios_base::in); | ||
|
||
Text text(stream, "UTF8", 3); | ||
|
||
REQUIRE(text == Text({ | ||
Line{u"abcdefg", LineEnding::LF}, | ||
Line{u"hijklmnop", LineEnding::NONE} | ||
})); | ||
} |