19 lines
502 B
C++
19 lines
502 B
C++
#include "gtest/gtest.h"
|
|
#include "jianzhi_offer.h"
|
|
|
|
TEST(ReplaceSpaceTest, BasicAssertions) {
|
|
std::string input = "We are happy.";
|
|
std::string expected = "We%20are%20happy.";
|
|
|
|
yaha::String s;
|
|
ASSERT_EQ(expected, s.replace_space(input));
|
|
}
|
|
|
|
TEST(IsNumberTest, BasicAssertions) {
|
|
yaha::String s;
|
|
ASSERT_TRUE(s.is_number("0"));
|
|
ASSERT_TRUE(s.is_number(" .1 "));
|
|
ASSERT_FALSE(s.is_number("."));
|
|
ASSERT_FALSE(s.is_number("e"));
|
|
ASSERT_FALSE(s.is_number("e9"));
|
|
} |