mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-24 03:00:16 +00:00
Improve StringRef test
This commit is contained in:
parent
6a52fc164a
commit
5b0a9bbe85
@ -699,8 +699,11 @@ void test_count_digits() {
|
||||
}
|
||||
|
||||
TEST(UtilTest, StringRef) {
|
||||
char space[100] = "some string";
|
||||
EXPECT_EQ(std::strlen(space), StringRef(space).size());
|
||||
// Test that StringRef::size() returns string length, not buffer size.
|
||||
enum {BUFFER_SIZE = 100};
|
||||
char str[BUFFER_SIZE] = "some string";
|
||||
EXPECT_EQ(std::strlen(str), StringRef(str).size());
|
||||
EXPECT_LT(std::strlen(str), BUFFER_SIZE);
|
||||
}
|
||||
|
||||
TEST(UtilTest, CountDigits) {
|
||||
|
Loading…
Reference in New Issue
Block a user