Changeset 790 in openpam
- Timestamp:
- Mar 17, 2014, 2:08:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/t/t_openpam_readword.c
r648 r790 171 171 } 172 172 173 T_FUNC(line_continuation_in_whitespace, "line continuation in whitespace") 174 { 175 struct t_file *tf; 176 int ret; 177 178 tf = t_fopen(NULL); 179 t_fprintf(tf, " \\\n \n"); 180 t_frewind(tf); 181 ret = orw_expect(tf, NULL, 1 /*lines*/, 0 /*eof*/, 1 /*eol*/); 182 t_fclose(tf); 183 return (ret); 184 } 185 173 186 T_FUNC(comment, "comment") 174 187 { … … 193 206 t_frewind(tf); 194 207 ret = orw_expect(tf, NULL, 0 /*lines*/, 0 /*eof*/, 1 /*eol*/); 208 t_fclose(tf); 209 return (ret); 210 } 211 212 T_FUNC(single_quoted_comment, "single-quoted comment") 213 { 214 struct t_file *tf; 215 int ret; 216 217 tf = t_fopen(NULL); 218 t_fprintf(tf, " '# comment'\n"); 219 t_frewind(tf); 220 ret = orw_expect(tf, "# comment", 0 /*lines*/, 0 /*eof*/, 1 /*eol*/); 221 t_fclose(tf); 222 return (ret); 223 } 224 225 T_FUNC(double_quoted_comment, "double-quoted comment") 226 { 227 struct t_file *tf; 228 int ret; 229 230 tf = t_fopen(NULL); 231 t_fprintf(tf, " \"# comment\"\n"); 232 t_frewind(tf); 233 ret = orw_expect(tf, "# comment", 0 /*lines*/, 0 /*eof*/, 1 /*eol*/); 234 t_fclose(tf); 235 return (ret); 236 } 237 238 T_FUNC(comment_at_eof, "comment at end of file") 239 { 240 struct t_file *tf; 241 int ret; 242 243 tf = t_fopen(NULL); 244 t_fprintf(tf, "# comment"); 245 t_frewind(tf); 246 ret = orw_expect(tf, NULL, 0 /*lines*/, 1 /*eof*/, 0 /*eol*/); 195 247 t_fclose(tf); 196 248 return (ret); … … 418 470 } 419 471 472 T_FUNC(escaped_comment, "escaped comment") 473 { 474 struct t_file *tf; 475 int ret; 476 477 tf = t_fopen(NULL); 478 t_fprintf(tf, " \\# comment\n"); 479 t_frewind(tf); 480 ret = orw_expect(tf, "#", 0 /*lines*/, 0 /*eof*/, 0 /*eol*/) && 481 orw_expect(tf, "comment", 0 /*lines*/, 0 /*eof*/, 1 /*eol*/); 482 t_fclose(tf); 483 return (ret); 484 } 485 486 T_FUNC(escape_at_eof, "escape at end of file") 487 { 488 struct t_file *tf; 489 int ret; 490 491 tf = t_fopen(NULL); 492 t_fprintf(tf, "z\\"); 493 t_frewind(tf); 494 ret = orw_expect(tf, NULL, 0 /*lines*/, 1 /*eof*/, 0 /*eol*/); 495 t_fclose(tf); 496 return (ret); 497 } 498 420 499 421 500 … … 836 915 T(single_whitespace), 837 916 T(multiple_whitespace), 917 T(line_continuation_in_whitespace), 838 918 T(comment), 839 919 T(whitespace_before_comment), 920 T(single_quoted_comment), 921 T(double_quoted_comment), 922 T(comment_at_eof), 840 923 841 924 T(single_word), … … 855 938 T(escaped_newline_after_word), 856 939 T(escaped_letter), 940 T(escaped_comment), 941 T(escape_at_eof), 857 942 858 943 T(naked_single_quote),
Note: See TracChangeset
for help on using the changeset viewer.