Lines Matching refs:cellescape
133 TEST(cellescape) { in TEST() argument
136 assert_se(streq(cellescape(buf, 1, ""), "")); in TEST()
137 assert_se(streq(cellescape(buf, 1, "1"), "")); in TEST()
138 assert_se(streq(cellescape(buf, 1, "12"), "")); in TEST()
140 assert_se(streq(cellescape(buf, 2, ""), "")); in TEST()
141 assert_se(streq(cellescape(buf, 2, "1"), "1")); in TEST()
142 assert_se(streq(cellescape(buf, 2, "12"), ".")); in TEST()
143 assert_se(streq(cellescape(buf, 2, "123"), ".")); in TEST()
145 assert_se(streq(cellescape(buf, 3, ""), "")); in TEST()
146 assert_se(streq(cellescape(buf, 3, "1"), "1")); in TEST()
147 assert_se(streq(cellescape(buf, 3, "12"), "12")); in TEST()
148 assert_se(streq(cellescape(buf, 3, "123"), "..")); in TEST()
149 assert_se(streq(cellescape(buf, 3, "1234"), "..")); in TEST()
151 assert_se(streq(cellescape(buf, 4, ""), "")); in TEST()
152 assert_se(streq(cellescape(buf, 4, "1"), "1")); in TEST()
153 assert_se(streq(cellescape(buf, 4, "12"), "12")); in TEST()
154 assert_se(streq(cellescape(buf, 4, "123"), "123")); in TEST()
155 assert_se(streq(cellescape(buf, 4, "1234"), is_locale_utf8() ? "…" : "...")); in TEST()
156 assert_se(streq(cellescape(buf, 4, "12345"), is_locale_utf8() ? "…" : "...")); in TEST()
158 assert_se(streq(cellescape(buf, 5, ""), "")); in TEST()
159 assert_se(streq(cellescape(buf, 5, "1"), "1")); in TEST()
160 assert_se(streq(cellescape(buf, 5, "12"), "12")); in TEST()
161 assert_se(streq(cellescape(buf, 5, "123"), "123")); in TEST()
162 assert_se(streq(cellescape(buf, 5, "1234"), "1234")); in TEST()
163 assert_se(streq(cellescape(buf, 5, "12345"), is_locale_utf8() ? "1…" : "1...")); in TEST()
164 assert_se(streq(cellescape(buf, 5, "123456"), is_locale_utf8() ? "1…" : "1...")); in TEST()
166 assert_se(streq(cellescape(buf, 1, "\020"), "")); in TEST()
167 assert_se(streq(cellescape(buf, 2, "\020"), ".")); in TEST()
168 assert_se(streq(cellescape(buf, 3, "\020"), "..")); in TEST()
169 assert_se(streq(cellescape(buf, 4, "\020"), is_locale_utf8() ? "…" : "...")); in TEST()
170 assert_se(streq(cellescape(buf, 5, "\020"), "\\020")); in TEST()
172 assert_se(streq(cellescape(buf, 5, "1234\020"), is_locale_utf8() ? "1…" : "1...")); in TEST()
173 assert_se(streq(cellescape(buf, 6, "1234\020"), is_locale_utf8() ? "12…" : "12...")); in TEST()
174 assert_se(streq(cellescape(buf, 7, "1234\020"), is_locale_utf8() ? "123…" : "123...")); in TEST()
175 assert_se(streq(cellescape(buf, 8, "1234\020"), is_locale_utf8() ? "1234…" : "1234...")); in TEST()
176 assert_se(streq(cellescape(buf, 9, "1234\020"), "1234\\020")); in TEST()
178 assert_se(streq(cellescape(buf, 1, "\t\n"), "")); in TEST()
179 assert_se(streq(cellescape(buf, 2, "\t\n"), ".")); in TEST()
180 assert_se(streq(cellescape(buf, 3, "\t\n"), "..")); in TEST()
181 assert_se(streq(cellescape(buf, 4, "\t\n"), is_locale_utf8() ? "…" : "...")); in TEST()
182 assert_se(streq(cellescape(buf, 5, "\t\n"), "\\t\\n")); in TEST()
184 assert_se(streq(cellescape(buf, 5, "1234\t\n"), is_locale_utf8() ? "1…" : "1...")); in TEST()
185 assert_se(streq(cellescape(buf, 6, "1234\t\n"), is_locale_utf8() ? "12…" : "12...")); in TEST()
186 assert_se(streq(cellescape(buf, 7, "1234\t\n"), is_locale_utf8() ? "123…" : "123...")); in TEST()
187 assert_se(streq(cellescape(buf, 8, "1234\t\n"), is_locale_utf8() ? "1234…" : "1234...")); in TEST()
188 assert_se(streq(cellescape(buf, 9, "1234\t\n"), "1234\\t\\n")); in TEST()
190 assert_se(streq(cellescape(buf, 4, "x\t\020\n"), is_locale_utf8() ? "…" : "...")); in TEST()
191 assert_se(streq(cellescape(buf, 5, "x\t\020\n"), is_locale_utf8() ? "x…" : "x...")); in TEST()
192 assert_se(streq(cellescape(buf, 6, "x\t\020\n"), is_locale_utf8() ? "x…" : "x...")); in TEST()
193 assert_se(streq(cellescape(buf, 7, "x\t\020\n"), is_locale_utf8() ? "x\\t…" : "x\\t...")); in TEST()
194 assert_se(streq(cellescape(buf, 8, "x\t\020\n"), is_locale_utf8() ? "x\\t…" : "x\\t...")); in TEST()
195 assert_se(streq(cellescape(buf, 9, "x\t\020\n"), is_locale_utf8() ? "x\\t…" : "x\\t...")); in TEST()
196 assert_se(streq(cellescape(buf, 10, "x\t\020\n"), "x\\t\\020\\n")); in TEST()
198 assert_se(streq(cellescape(buf, 6, "1\011"), "1\\t")); in TEST()
199 assert_se(streq(cellescape(buf, 6, "1\020"), "1\\020")); in TEST()
200 assert_se(streq(cellescape(buf, 6, "1\020x"), is_locale_utf8() ? "1…" : "1...")); in TEST()
202 assert_se(streq(cellescape(buf, 40, "1\020"), "1\\020")); in TEST()
203 assert_se(streq(cellescape(buf, 40, "1\020x"), "1\\020x")); in TEST()
205 … assert_se(streq(cellescape(buf, 40, "\a\b\f\n\r\t\v\\\"'"), "\\a\\b\\f\\n\\r\\t\\v\\\\\\\"\\'")); in TEST()
206 … assert_se(streq(cellescape(buf, 6, "\a\b\f\n\r\t\v\\\"'"), is_locale_utf8() ? "\\a…" : "\\a...")); in TEST()
207 … assert_se(streq(cellescape(buf, 7, "\a\b\f\n\r\t\v\\\"'"), is_locale_utf8() ? "\\a…" : "\\a...")); in TEST()
208 …assert_se(streq(cellescape(buf, 8, "\a\b\f\n\r\t\v\\\"'"), is_locale_utf8() ? "\\a\\b…" : "\\a\\b.… in TEST()
210 assert_se(streq(cellescape(buf, sizeof buf, "1\020"), "1\\020")); in TEST()
211 assert_se(streq(cellescape(buf, sizeof buf, "1\020x"), "1\\020x")); in TEST()