-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(stdlib) Support comparison between
UTF8String
and ASCIIString
...as long as the content is ASCII-only in both strings. https://gitlab.perlang.org/perlang/perlang/-/merge_requests/560
- Loading branch information
Showing
10 changed files
with
137 additions
and
34 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
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
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,22 @@ | ||
// utf8_string.cc - tests for the perlang::UTF8String | ||
|
||
#include <catch2/catch_test_macros.hpp> | ||
#include <memory> | ||
|
||
#include "perlang_stdlib.h" | ||
|
||
TEST_CASE( "perlang::UTF8String::is_ascii(), returns true for ASCII-only string" ) | ||
{ | ||
std::shared_ptr<perlang::UTF8String> s = perlang::UTF8String::from_static_string("this is a an ASCII string"); | ||
|
||
// Assert | ||
REQUIRE(s->is_ascii()); | ||
} | ||
|
||
TEST_CASE( "perlang::UTF8String::is_ascii(), returns true for non-ASCII string" ) | ||
{ | ||
std::shared_ptr<perlang::UTF8String> s = perlang::UTF8String::from_static_string("this is a string with non-ASCII characters: åäöÅÄÖéèüÜÿŸïÏすし"); | ||
|
||
// Assert | ||
REQUIRE_FALSE(s->is_ascii()); | ||
} |