Home | History | Annotate | Download | only in string_append

Lines Matching defs:sv

23 template <class S, class SV>
25 test(S s, SV sv, typename S::size_type pos, typename S::size_type n, S expected)
27 if (pos <= sv.size())
29 s.append(sv, pos, n);
38 s.append(sv, pos, n);
43 assert(pos > sv.size());
49 template <class S, class SV>
51 test_npos(S s, SV sv, typename S::size_type pos, S expected)
53 if (pos <= sv.size())
55 s.append(sv, pos);
64 s.append(sv, pos);
69 assert(pos > sv.size());
79 typedef std::string_view SV;
80 test(S(), SV(), 0, 0, S());
81 test(S(), SV(), 1, 0, S());
82 test(S(), SV("12345"), 0, 3, S("123"));
83 test(S(), SV("12345"), 1, 4, S("2345"));
84 test(S(), SV("12345"), 3, 15, S("45"));
85 test(S(), SV("12345"), 5, 15, S(""));
86 test(S(), SV("12345"), 6, 15, S("not happening"));
87 test(S(), SV("12345678901234567890"), 0, 0, S());
88 test(S(), SV("12345678901234567890"), 1, 1, S("2"));
89 test(S(), SV("12345678901234567890"), 2, 3, S("345"));
90 test(S(), SV("12345678901234567890"), 12, 13, S("34567890"));
91 test(S(), SV("12345678901234567890"), 21, 13, S("not happening"));
93 test(S("12345"), SV(), 0, 0, S("12345"));
94 test(S("12345"), SV("12345"), 2, 2, S("1234534"));
95 test(S("12345"), SV("1234567890"), 0, 100, S("123451234567890"));
97 test(S("12345678901234567890"), SV(), 0, 0, S("12345678901234567890"));
98 test(S("12345678901234567890"), SV("12345"), 1, 3, S("12345678901234567890234"));
99 test(S("12345678901234567890"), SV("12345678901234567890"), 5, 10,
105 typedef std::basic_string_view<char, std::char_traits<char> > SV;
106 test(S(), SV(), 0, 0, S());
107 test(S(), SV(), 1, 0, S());
108 test(S(), SV("12345"), 0, 3, S("123"));
109 test(S(), SV("12345"), 1, 4, S("2345"));
110 test(S(), SV("12345"), 3, 15, S("45"));
111 test(S(), SV("12345"), 5, 15, S(""));
112 test(S(), SV("12345"), 6, 15, S("not happening"));
113 test(S(), SV("12345678901234567890"), 0, 0, S());
114 test(S(), SV("12345678901234567890"), 1, 1, S("2"));
115 test(S(), SV("12345678901234567890"), 2, 3, S("345"));
116 test(S(), SV("12345678901234567890"), 12, 13, S("34567890"));
117 test(S(), SV("12345678901234567890"), 21, 13, S("not happening"));
119 test(S("12345"), SV(), 0, 0, S("12345"));
120 test(S("12345"), SV("12345"), 2, 2, S("1234534"));
121 test(S("12345"), SV("1234567890"), 0, 100, S("123451234567890"));
123 test(S("12345678901234567890"), SV(), 0, 0, S("12345678901234567890"));
124 test(S("12345678901234567890"), SV("12345"), 1, 3, S("12345678901234567890234"));
125 test(S("12345678901234567890"), SV("12345678901234567890"), 5, 10,
131 typedef std::string_view SV;
132 test_npos(S(), SV(), 0, S());
133 test_npos(S(), SV(), 1, S());
134 test_npos(S(), SV("12345"), 0, S("12345"));
135 test_npos(S(), SV("12345"), 1, S("2345"));
136 test_npos(S(), SV("12345"), 3, S("45"));
137 test_npos(S(), SV("12345"), 5, S(""));
138 test_npos(S(), SV("12345"), 6, S("not happening"));
143 std::string_view sv = "EFGH";
154 s.append(sv, 0); // calls append(T, pos, npos)
155 assert(s == sv);
158 s.append(sv, 0, std::string::npos); // calls append(T, pos, npos)
159 assert(s == sv);
177 std::string_view sv = s;
178 s.append(sv);
181 sv = s;
182 s.append(sv, 0, std::string::npos);
185 sv = s;
186 s.append(sv, sv.size());
192 std::string_view sv = s;
193 s.append(sv);
196 sv = s;
197 s.append(sv, 0, std::string::npos);