Lines Matching refs:StringHelper
24 using ::android::StringHelper;
29 EXPECT_TRUE(StringHelper::EndsWith("", "")); in TEST_F()
30 EXPECT_TRUE(StringHelper::EndsWith("a", "")); in TEST_F()
31 EXPECT_TRUE(StringHelper::EndsWith("b", "b")); in TEST_F()
32 EXPECT_TRUE(StringHelper::EndsWith("ab", "b")); in TEST_F()
33 EXPECT_TRUE(StringHelper::EndsWith("ab", "ab")); in TEST_F()
34 EXPECT_TRUE(StringHelper::EndsWith("abcd", "bcd")); in TEST_F()
35 EXPECT_TRUE(StringHelper::EndsWith("abcd", "abcd")); in TEST_F()
36 EXPECT_TRUE(StringHelper::EndsWith("abcdefghijk", "ijk")); in TEST_F()
37 EXPECT_TRUE(StringHelper::EndsWith("abcdefghijk", "bcdefghijk")); in TEST_F()
39 EXPECT_FALSE(StringHelper::EndsWith("", "a")); in TEST_F()
40 EXPECT_FALSE(StringHelper::EndsWith("b", "a")); in TEST_F()
41 EXPECT_FALSE(StringHelper::EndsWith("abcd", "ab")); in TEST_F()
45 EXPECT_TRUE(StringHelper::StartsWith("", "")); in TEST_F()
46 EXPECT_TRUE(StringHelper::StartsWith("a", "")); in TEST_F()
47 EXPECT_TRUE(StringHelper::StartsWith("b", "b")); in TEST_F()
48 EXPECT_TRUE(StringHelper::StartsWith("ab", "a")); in TEST_F()
49 EXPECT_TRUE(StringHelper::StartsWith("ab", "ab")); in TEST_F()
50 EXPECT_TRUE(StringHelper::StartsWith("abcd", "abc")); in TEST_F()
51 EXPECT_TRUE(StringHelper::StartsWith("abcd", "abcd")); in TEST_F()
52 EXPECT_TRUE(StringHelper::StartsWith("abcdefghijk", "abc")); in TEST_F()
53 EXPECT_TRUE(StringHelper::StartsWith("abcdefghijk", "abcdefghij")); in TEST_F()
55 EXPECT_FALSE(StringHelper::StartsWith("", "a")); in TEST_F()
56 EXPECT_FALSE(StringHelper::StartsWith("b", "a")); in TEST_F()
57 EXPECT_FALSE(StringHelper::StartsWith("abcd", "cd")); in TEST_F()
61 EXPECT_EQ("", StringHelper::LTrim("", "")); in TEST_F()
62 EXPECT_EQ("", StringHelper::LTrim("", "a")); in TEST_F()
63 EXPECT_EQ("", StringHelper::LTrim("a", "a")); in TEST_F()
64 EXPECT_EQ("a", StringHelper::LTrim("a", "")); in TEST_F()
65 EXPECT_EQ("a", StringHelper::LTrim("a", "b")); in TEST_F()
66 EXPECT_EQ("a", StringHelper::LTrim("ba", "b")); in TEST_F()
67 EXPECT_EQ("f", StringHelper::LTrim("abcdef", "abcde")); in TEST_F()
68 EXPECT_EQ("cdef", StringHelper::LTrim("abcdef", "ab")); in TEST_F()
69 EXPECT_EQ("abcdef", StringHelper::LTrim("abcdef", "")); in TEST_F()
71 EXPECT_EQ("", StringHelper::RTrim("", "")); in TEST_F()
72 EXPECT_EQ("", StringHelper::RTrim("", "a")); in TEST_F()
73 EXPECT_EQ("", StringHelper::RTrim("a", "a")); in TEST_F()
74 EXPECT_EQ("a", StringHelper::RTrim("a", "")); in TEST_F()
75 EXPECT_EQ("a", StringHelper::RTrim("a", "b")); in TEST_F()
76 EXPECT_EQ("a", StringHelper::RTrim("ab", "b")); in TEST_F()
77 EXPECT_EQ("a", StringHelper::RTrim("abcdef", "bcdef")); in TEST_F()
78 EXPECT_EQ("abcd", StringHelper::RTrim("abcdef", "ef")); in TEST_F()
79 EXPECT_EQ("abcdef", StringHelper::RTrim("abcdef", "")); in TEST_F()
83 EXPECT_EQ("", StringHelper::LTrimAll("", "")); in TEST_F()
84 EXPECT_EQ("", StringHelper::LTrimAll("", "a")); in TEST_F()
85 EXPECT_EQ("", StringHelper::LTrimAll("", "ab")); in TEST_F()
86 EXPECT_EQ("", StringHelper::LTrimAll("a", "a")); in TEST_F()
87 EXPECT_EQ("", StringHelper::LTrimAll("aa", "a")); in TEST_F()
88 EXPECT_EQ("b", StringHelper::LTrimAll("b", "a")); in TEST_F()
89 EXPECT_EQ("b", StringHelper::LTrimAll("aaab", "a")); in TEST_F()
90 EXPECT_EQ("c", StringHelper::LTrimAll("ababc", "ab")); in TEST_F()
91 EXPECT_EQ("ac", StringHelper::LTrimAll("abac", "ab")); in TEST_F()
93 EXPECT_EQ("", StringHelper::RTrimAll("", "")); in TEST_F()
94 EXPECT_EQ("", StringHelper::RTrimAll("", "a")); in TEST_F()
95 EXPECT_EQ("", StringHelper::RTrimAll("", "ab")); in TEST_F()
96 EXPECT_EQ("", StringHelper::RTrimAll("a", "a")); in TEST_F()
97 EXPECT_EQ("", StringHelper::RTrimAll("aa", "a")); in TEST_F()
98 EXPECT_EQ("b", StringHelper::RTrimAll("b", "a")); in TEST_F()
99 EXPECT_EQ("b", StringHelper::RTrimAll("baaa", "a")); in TEST_F()
100 EXPECT_EQ("c", StringHelper::RTrimAll("cabab", "ab")); in TEST_F()
101 EXPECT_EQ("ca", StringHelper::RTrimAll("caba", "ba")); in TEST_F()
107 StringHelper::SplitString("", '.', &components); in TEST_F()
109 StringHelper::SplitString("a.", '.', &components); in TEST_F()
111 StringHelper::SplitString(".a", '.', &components); in TEST_F()
113 StringHelper::SplitString("..", '.', &components); in TEST_F()
115 StringHelper::SplitString("asdf.asdf", '.', &components); in TEST_F()
120 EXPECT_EQ("", StringHelper::JoinStrings({}, "")); in TEST_F()
121 EXPECT_EQ("", StringHelper::JoinStrings({}, "a")); in TEST_F()
122 EXPECT_EQ("a", StringHelper::JoinStrings({"a"}, "")); in TEST_F()
123 EXPECT_EQ("a,b", StringHelper::JoinStrings({"a", "b"}, ",")); in TEST_F()
124 EXPECT_EQ("ab,", StringHelper::JoinStrings({"ab", ""}, ",")); in TEST_F()
125 EXPECT_EQ(",ab", StringHelper::JoinStrings({"", "ab"}, ",")); in TEST_F()
126 EXPECT_EQ("a.,b", StringHelper::JoinStrings({"a", "b"}, ".,")); in TEST_F()
127 EXPECT_EQ("a,b,c", StringHelper::JoinStrings({"a", "b", "c"}, ",")); in TEST_F()
128 EXPECT_EQ("abc.,def.,ghi", StringHelper::JoinStrings({"abc", "def", "ghi"}, ".,")); in TEST_F()
135 EXPECT_EQ("UPPER_SNAKE_CASE", StringHelper::ToUpperSnakeCase("UPPER_SNAKE_CASE")); in TEST_F()
136 EXPECT_EQ("UPPER_SNAKE_CASE", StringHelper::ToUpperSnakeCase("upper_snake_case")); in TEST_F()
137 EXPECT_EQ("UPPER_SNAKE_CASE", StringHelper::ToUpperSnakeCase("UpperSnakeCase")); in TEST_F()
138 EXPECT_EQ("UPPER_SNAKE_CASE", StringHelper::ToUpperSnakeCase("upperSnakeCase")); in TEST_F()
143 EXPECT_EQ("SOME_3D_TEXT", StringHelper::ToUpperSnakeCase("Some_3D_Text")); in TEST_F()
144 EXPECT_EQ("IPV4_ADDR", StringHelper::ToUpperSnakeCase("Ipv4Addr")); in TEST_F()
145 EXPECT_EQ("IPV4_ADDR", StringHelper::ToUpperSnakeCase("Ipv4_Addr")); in TEST_F()
148 EXPECT_EQ("UI_ERROR", StringHelper::ToUpperSnakeCase("UIError")); in TEST_F()
149 EXPECT_EQ("UI_ERROR", StringHelper::ToUpperSnakeCase("UI_Error")); in TEST_F()
150 EXPECT_EQ("PROTOCOL_B_PRIME", StringHelper::ToUpperSnakeCase("protocolBPrime")); in TEST_F()
151 EXPECT_EQ("PROTOCOL_B_PRIME", StringHelper::ToUpperSnakeCase("protocol_B_Prime")); in TEST_F()
154 EXPECT_EQ("VAL2", StringHelper::ToUpperSnakeCase("VAL2")); in TEST_F()
155 EXPECT_EQ("VAL2OTHER", StringHelper::ToUpperSnakeCase("VAL2OTHER")); in TEST_F()