2 * translate-test.c -- test the eol and keyword translation subroutine
4 * ====================================================================
5 * Copyright (c) 2000-2004 CollabNet. All rights reserved.
7 * This software is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at http://subversion.tigris.org/license-1.html.
10 * If newer versions of this license are posted there, you may use a
11 * newer version instead, at your option.
13 * This software consists of voluntary contributions made by many
14 * individuals. For exact contribution history, see the revision
15 * history and logs, available at http://subversion.tigris.org/.
16 * ====================================================================
21 /* Advice to those adding new tests to this file:
22 * ==============================================
24 * Read the doc string for substitute_and_verify(), then read the
25 * test functions themselves -- they're small, and they'll be very
26 * easy to understand once you know substitute_and_verify().
33 #include <apr_general.h>
34 #include <apr_file_io.h>
35 #include "svn_pools.h"
36 #include "svn_subst.h"
38 #include "../svn_test.h"
43 /* (Almost) all the tests share the same test data. */
46 "Line 1: fairly boring subst test data... blah blah",
47 "Line 2: fairly boring subst test data... blah blah.",
48 "Line 3: Valid $LastChangedRevision$, started unexpanded.",
49 "Line 4: fairly boring subst test data... blah blah.",
50 "Line 5: Valid $Rev$, started unexpanded.",
51 "Line 6: fairly boring subst test data... blah blah.",
52 "Line 7: fairly boring subst test data... blah blah.",
53 "Line 8: Valid $LastChangedBy$, started unexpanded.",
54 "Line 9: Valid $Author$, started unexpanded.",
55 "Line 10: fairly boring subst test data... blah blah.",
56 "Line 11: fairly boring subst test data... blah blah.",
57 "Line 12: Valid $LastChangedDate$, started unexpanded.",
58 "Line 13: Valid $Date$, started unexpanded.",
59 "Line 14: fairly boring subst test data... blah blah.",
60 "Line 15: fairly boring subst test data... blah blah.",
61 "Line 16: Valid $HeadURL$, started unexpanded.",
62 "Line 17: Valid $URL$, started unexpanded.",
63 "Line 18: fairly boring subst test data... blah blah.",
64 "Line 19: Invalid expanded keyword spanning two lines: $Author: ",
65 /* The idea here is that, were it not broken across two lines,
66 "$Author: Line 20: jrandom$" would be a valid if odd, keyword. */
67 "Line 20: jrandom$ remainder of invalid keyword spanning two lines.",
68 "Line 21: fairly boring subst test data... blah blah.",
69 "Line 22: an unknown keyword $LastChangedSocks$.",
70 "Line 23: fairly boring subst test data... blah blah.",
71 /* In line 24, the third dollar sign terminates the first, and the
72 fourth should therefore remain a literal dollar sign. */
73 "Line 24: keyword in a keyword: $Author: $Date$ $",
74 "Line 25: fairly boring subst test data... blah blah.",
75 "Line 26: Emptily expanded keyword $Rev: $.",
76 "Line 27: fairly boring subst test data... blah blah.",
77 "Line 28: fairly boring subst test data... blah blah.",
78 "Line 29: Valid $LastChangedRevision: 1729 $, started expanded.",
79 "Line 30: Valid $Rev: 1729 $, started expanded.",
80 "Line 31: fairly boring subst test data... blah blah.",
81 "Line 32: fairly boring subst test data... blah blah.",
82 "Line 33: Valid $LastChangedDate: 2002-01-01 $, started expanded.",
83 "Line 34: Valid $Date: 2002-01-01 $, started expanded.",
84 "Line 35: fairly boring subst test data... blah blah.",
85 "Line 36: fairly boring subst test data... blah blah.",
86 "Line 37: Valid $LastChangedBy: jrandom $, started expanded.",
87 "Line 38: Valid $Author: jrandom $, started expanded.",
88 "Line 39: fairly boring subst test data... blah blah.",
89 "Line 40: fairly boring subst test data... blah blah.",
90 "Line 41: Valid $HeadURL: http://tomato/mauve $, started expanded.",
91 "Line 42: Valid $URL: http://tomato/mauve $, started expanded.",
92 "Line 43: fairly boring subst test data... blah blah.",
93 "Line 44: fairly boring subst test data... blah blah.",
94 "Line 45: Invalid $LastChangedRevisionWithSuffix$, started unexpanded.",
95 "Line 46: Empty $Author:$, started expanded.",
96 "Line 47: fairly boring subst test data... blah blah.",
97 "Line 48: Two keywords back to back: $Author$$Rev$.",
98 "Line 49: One keyword, one not, back to back: $Author$Rev$.",
99 "Line 50: a series of dollar signs $$$$$$$$$$$$$$$$$$$$$$$$$$$$.",
100 "Line 51: same, but with embedded keyword $$$$$$$$Date$$$$$$$$$$.",
101 "Line 52: same, with expanded, empty keyword $$$$$$Date: $$$$$$.",
102 "Line 53: $This is a lengthy line designed to test a bug that was "
103 "reported about keyword expansion. The problem was that a line "
104 "had more than SVN_KEYWORD_MAX_LEN (255 at the time) characters "
105 "after an initial dollar sign, which triggered a buglet in our "
106 "svn_subst_copy_and_translate() function and resulted in, in some cases "
107 "a SEGFAULT, and in others a filthy corrupt commit. ",
108 "", /* Lines 54-69 are blank to test consecutive newlines */
124 "$Author$Rev$.", /* Line 70-73 test places where '$' abuts a newline. */
128 /* Line 74-75 test for keywords containing '$', issue #1780 */
129 "Line 74: Valid $Author: jran$dom $, started expanded.",
130 "Line 75: Valid $URL: http://tomato/mau$ve $, started expanded.",
131 /* Line 76-78 tests for a string with an unknown keyword of 252-254 bytes
145 /* Testing border cases, line 79-82 test for valid keywords, keywords on
146 line 83-84 are too long */
147 "Line 79: Valid $Author: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
148 "aaaaaaaaaaaaa$aaaaaaaaaaaaaaaaaaaaaa$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
149 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
150 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa $, started expanded.",
151 "Line 80: Valid $Author: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$aaaaaaaaaaaaaaa"
152 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$aaaaaaaaaaaaaaaaaa"
153 "aaaaaaa$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
154 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$aaaaaaa $, started "
156 /* keyword from first dollar sign to last = 254 chars */
157 "Line 81: Valid $Author: aaaaaaaaaaaaaaaaaaaa$aaaaaaaaaaaaaaaaaaaaaaaaaaa"
158 "aaaaaaaaaaaaa$aaaaaaaaaaaaaaaaaaaa$$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
159 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$$aaaaaaaaaaaaaaaaaaaaaaaaa"
160 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$$aaaaaa$$$ $, started "
162 /* keyword from first dollar sign to last = 255 chars */
163 "Line 82: Valid $Author: aaaaaaaaaaa$$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
164 "aaaaaaaaaaaaaaaaaaaaaaaaaa$$$$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
165 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$$aaaaaaaaaaaaaaaaaaaaaaaaaaa"
166 "aaaaaaaaaaaaaa$$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$$$ $, started "
168 /* keyword from first dollar sign to last = 256 chars */
169 "Line 83: Invalid $Author: aaaaaaaaaaa$$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
170 "aaaaaaaaaaaaaaaaaaaaaaaaaa$$$$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
171 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$$aaaaaaaaaaaaaaaaaaaaaaaaaaa"
172 "aaaaaaaaaaaaaa$$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$$$ $, started "
174 "Line 84: Invalid $Author: aaaaaaaaaaa$$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
175 "aaaaaaaaaaaaaaaaaaaaaaaaaa$$$$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
176 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$$aaaaaaaaaaaaaaaaaaaaaaaaaaa"
177 "aaaaaaaaaaaaaa$$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$$$ $, started "
179 "Line 85: end of subst test data."
183 /* Return a randomly selected eol sequence. */
185 random_eol_marker(void)
187 /* Select a random eol marker from this set. */
188 static int seeded
= 0;
190 /* ### todo: allowing '\r' to be in this list of possible random
191 eol_markers causes problems for the current testing framework
192 which expects a 1:1 ratio of input-line-count to output-line-count.
193 Problems occur when there are two consecutive line ending markers
194 where the first is '\r' and the second is '\n' -- our
195 translation routine reads that as a single '\r\n' which throws
196 off the linecount on the output side, and fouls up substitute_and_verify.
198 const char *eol_markers
[] = { "\n", "\r\n" };
202 srand(1729); /* we want errors to be reproducible */
206 return eol_markers
[rand()
207 % ((sizeof(eol_markers
)) / (sizeof(*eol_markers
)))];
211 /* Create FNAME with global `lines' as initial data. Use EOL_STR as
212 * the end-of-line marker between lines, or if EOL_STR is NULL, choose
213 * a random marker at each opportunity. Use POOL for any temporary
217 create_file(const char *fname
, const char *eol_str
, apr_pool_t
*pool
)
219 apr_status_t apr_err
;
223 apr_err
= apr_file_open(&f
, fname
,
224 (APR_WRITE
| APR_CREATE
| APR_EXCL
| APR_BINARY
),
225 APR_OS_DEFAULT
, pool
);
227 return svn_error_create(apr_err
, NULL
, fname
);
229 for (i
= 0; i
< (sizeof(lines
) / sizeof(*lines
)); i
++)
231 const char *this_eol_str
= eol_str
? eol_str
: random_eol_marker();
233 apr_err
= apr_file_printf(f
, lines
[i
]);
235 /* Is it overly paranoid to use putc(), because of worry about
236 fprintf() doing a newline conversion? */
237 for (j
= 0; this_eol_str
[j
]; j
++)
239 apr_err
= apr_file_putc(this_eol_str
[j
], f
);
241 return svn_error_create(apr_err
, NULL
, fname
);
245 apr_err
= apr_file_close(f
);
247 return svn_error_create(apr_err
, NULL
, fname
);
253 /* If FNAME is a regular file, remove it; if it doesn't exist at all,
254 return success. Otherwise, return error. */
256 remove_file(const char *fname
, apr_pool_t
*pool
)
258 apr_status_t apr_err
;
261 if (apr_stat(&finfo
, fname
, APR_FINFO_TYPE
, pool
) == APR_SUCCESS
)
263 if (finfo
.filetype
== APR_REG
)
265 apr_err
= apr_file_remove(fname
, pool
);
267 return svn_error_create(apr_err
, NULL
, fname
);
270 return svn_error_createf(SVN_ERR_TEST_FAILED
, NULL
,
271 "non-file '%s' is in the way", fname
);
278 /* Set up, run, and verify the results of a substitution.
280 * Create a file TEST_NAME.src using global `lines' as the initial
281 * data, with SRC_EOL as the line separator, then convert it to file
282 * TEST_NAME.dst (using DST_EOL, REPAIR, EXPAND, REV, AUTHOR, DATE,
283 * and URL as svn_subst_copy_and_translate() does), and verify that the
284 * conversion worked. Null SRC_EOL means create a mixed eol src
287 * If the verification succeeds, remove both files and return
290 * If the verification fails, leave the files for post-mortem. If the
291 * failure is due to non-eol data being wrong, return
292 * SVN_ERR_MALFORMED_FILE. If the problem is an incorrect eol marker,
293 * return SVN_ERR_IO_UNKNOWN_EOL. If the problem is that a mixed eol
294 * style was repaired even though no repair flag was passed, return
295 * SVN_ERR_TEST_FAILED.
297 * Use POOL for temporary allocation.
299 * Note: as with svn_subst_copy_and_translate(), if any of DST_EOL, REV,
300 * AUTHOR, DATE, and/or URL is null, then that substitution is not
304 substitute_and_verify(const char *test_name
,
307 svn_boolean_t repair
,
312 svn_boolean_t expand
,
316 svn_stringbuf_t
*contents
;
317 apr_hash_t
*keywords
= apr_hash_make(pool
);
320 const char *expect
[(sizeof(lines
) / sizeof(*lines
))];
321 const char *src_fname
= apr_pstrcat(pool
, test_name
, ".src", NULL
);
322 const char *dst_fname
= apr_pstrcat(pool
, test_name
, ".dst", NULL
);
324 apr_pool_t
*subpool
= svn_pool_create(pool
);
326 /** Clean up from previous tests, set up src data, and convert. **/
327 SVN_ERR(remove_file(src_fname
, pool
));
328 SVN_ERR(remove_file(dst_fname
, pool
));
329 SVN_ERR(create_file(src_fname
, src_eol
, pool
));
333 val
= svn_string_create(rev
, pool
);
334 apr_hash_set(keywords
, SVN_KEYWORD_REVISION_LONG
,
335 APR_HASH_KEY_STRING
, val
);
336 apr_hash_set(keywords
, SVN_KEYWORD_REVISION_MEDIUM
,
337 APR_HASH_KEY_STRING
, val
);
338 apr_hash_set(keywords
, SVN_KEYWORD_REVISION_SHORT
,
339 APR_HASH_KEY_STRING
, val
);
343 val
= svn_string_create(date
, pool
);
344 apr_hash_set(keywords
, SVN_KEYWORD_DATE_LONG
,
345 APR_HASH_KEY_STRING
, val
);
346 apr_hash_set(keywords
, SVN_KEYWORD_DATE_SHORT
,
347 APR_HASH_KEY_STRING
, val
);
351 val
= svn_string_create(author
, pool
);
352 apr_hash_set(keywords
, SVN_KEYWORD_AUTHOR_LONG
,
353 APR_HASH_KEY_STRING
, val
);
354 apr_hash_set(keywords
, SVN_KEYWORD_AUTHOR_SHORT
,
355 APR_HASH_KEY_STRING
, val
);
359 val
= svn_string_create(url
, pool
);
360 apr_hash_set(keywords
, SVN_KEYWORD_URL_LONG
,
361 APR_HASH_KEY_STRING
, val
);
362 apr_hash_set(keywords
, SVN_KEYWORD_URL_SHORT
,
363 APR_HASH_KEY_STRING
, val
);
366 err
= svn_subst_copy_and_translate3(src_fname
, dst_fname
, dst_eol
, repair
,
367 keywords
, expand
, FALSE
, subpool
);
368 svn_pool_destroy(subpool
);
370 /* Conversion should have failed, if src has mixed eol, and the
371 repair flag was not set, and we requested eol translation. */
372 if ((! src_eol
) && dst_eol
&& (! repair
))
376 return svn_error_createf
377 (SVN_ERR_TEST_FAILED
, NULL
,
378 "translation of '%s' should have failed, but didn't", src_fname
);
380 else if (err
->apr_err
!= SVN_ERR_IO_INCONSISTENT_EOL
)
382 return svn_error_createf
383 (SVN_ERR_TEST_FAILED
, err
,
384 "translation of '%s' should fail, but not with this error",
389 svn_error_clear(err
);
390 SVN_ERR(remove_file(src_fname
, pool
));
399 /** Verify that the conversion worked. **/
401 for (i
= 0; i
< (sizeof(expect
) / sizeof(*expect
)); i
++)
402 expect
[i
] = lines
[i
];
404 /* Certain lines contain keywords; expect their expansions. */
410 apr_pstrcat(pool
, "Line 3: ",
411 "Valid $LastChangedRevision: ",
413 " $, started unexpanded.",
416 apr_pstrcat(pool
, "Line 5: ",
417 "Valid $Rev: ", rev
, " $, started unexpanded.",
420 apr_pstrcat(pool
, "Line 26: ",
421 "Emptily expanded keyword $Rev: ", rev
," $.",
424 apr_pstrcat(pool
, "Line 29: ",
425 "Valid $LastChangedRevision: ",
427 " $, started expanded.",
430 apr_pstrcat(pool
, "Line 30: ",
433 " $, started expanded.",
438 /* Lines 3 and 5 remain unchanged. */
440 "Line 26: Emptily expanded keyword $Rev$.";
442 "Line 29: Valid $LastChangedRevision$, started expanded.";
444 "Line 30: Valid $Rev$, started expanded.";
453 apr_pstrcat(pool
, "Line 12: ",
454 "Valid $LastChangedDate: ",
456 " $, started unexpanded.",
459 apr_pstrcat(pool
, "Line 13: ",
460 "Valid $Date: ", date
, " $, started unexpanded.",
463 apr_pstrcat(pool
, "Line 33: ",
464 "Valid $LastChangedDate: ",
466 " $, started expanded.",
469 apr_pstrcat(pool
, "Line 34: ",
470 "Valid $Date: ", date
, " $, started expanded.",
473 apr_pstrcat(pool
, "Line 51: ",
474 "same, but with embedded keyword ",
475 "$$$$$$$$Date: ", date
, " $$$$$$$$$$.",
478 apr_pstrcat(pool
, "Line 52: ",
479 "same, with expanded, empty keyword ",
480 "$$$$$$Date: ", date
, " $$$$$$.",
485 /* Lines 12 and 13 remain unchanged. */
487 "Line 33: Valid $LastChangedDate$, started expanded.";
489 "Line 34: Valid $Date$, started expanded.";
491 "Line 51: same, but with embedded keyword $$$$$$$$Date$$$$$$$$$$.";
493 "Line 52: same, with expanded, empty keyword $$$$$$Date$$$$$$.";
502 apr_pstrcat(pool
, "Line 8: ",
503 "Valid $LastChangedBy: ",
505 " $, started unexpanded.",
508 apr_pstrcat(pool
, "Line 9: ",
509 "Valid $Author: ", author
, " $, started unexpanded.",
512 apr_pstrcat(pool
, "Line 37: ",
513 "Valid $LastChangedBy: ", author
,
514 " $, started expanded.", NULL
);
516 apr_pstrcat(pool
, "Line 38: ",
517 "Valid $Author: ", author
, " $, started expanded.",
520 apr_pstrcat(pool
, "Line 46: ",
521 "Empty $Author: ", author
, " $, started expanded.",
524 apr_pstrcat(pool
, ".$veR$Author: ", author
, " $", NULL
);
527 apr_pstrcat(pool
, "Line 74: ",
528 "Valid $Author: ", author
, " $, started expanded.",
531 apr_pstrcat(pool
, "Line 79: ",
532 "Valid $Author: ", author
, " $, started expanded.",
535 apr_pstrcat(pool
, "Line 80: ",
536 "Valid $Author: ", author
, " $, started expanded.",
539 apr_pstrcat(pool
, "Line 81: ",
540 "Valid $Author: ", author
, " $, started expanded.",
543 apr_pstrcat(pool
, "Line 82: ",
544 "Valid $Author: ", author
, " $, started expanded.",
549 /* Lines 8, 9, and 71 remain unchanged. */
551 "Line 37: Valid $LastChangedBy$, started expanded.";
553 "Line 38: Valid $Author$, started expanded.";
555 "Line 46: Empty $Author$, started expanded.";
557 "Line 74: Valid $Author$, started expanded.";
559 "Line 79: Valid $Author$, started expanded.";
561 "Line 80: Valid $Author$, started expanded.";
563 "Line 81: Valid $Author$, started expanded.";
565 "Line 82: Valid $Author$, started expanded.";
574 apr_pstrcat(pool
, "Line 16: ",
575 "Valid $HeadURL: ", url
, " $, started unexpanded.",
578 apr_pstrcat(pool
, "Line 17: ",
579 "Valid $URL: ", url
, " $, started unexpanded.",
582 apr_pstrcat(pool
, "Line 41: ",
583 "Valid $HeadURL: ", url
, " $, started expanded.",
586 apr_pstrcat(pool
, "Line 42: ",
587 "Valid $URL: ", url
, " $, started expanded.",
590 apr_pstrcat(pool
, "Line 75: ",
591 "Valid $URL: ", url
, " $, started expanded.",
596 /* Lines 16 and 17 and remain unchanged. */
598 "Line 41: Valid $HeadURL$, started expanded.";
600 "Line 42: Valid $URL$, started expanded.";
602 "Line 75: Valid $URL$, started expanded.";
606 /* Handle lines 48, 49, and 70 specially, as they contains two valid
613 apr_pstrcat(pool
, "Line 48: ",
614 "Two keywords back to back: "
615 "$Author: ", author
, " $"
616 "$Rev: ", rev
, " $.",
619 apr_pstrcat(pool
, "Line 49: ",
620 "One keyword, one not, back to back: "
621 "$Author: ", author
, " $Rev$.",
624 apr_pstrcat(pool
, "$Author: ", author
, " $Rev$.", NULL
);
626 /* Else Lines 48, 49, and 70 remain unchanged. */
628 else if (rev
&& (! author
))
633 apr_pstrcat(pool
, "Line 48: ",
634 "Two keywords back to back: "
635 "$Author$$Rev: ", rev
, " $.",
638 apr_pstrcat(pool
, "Line 49: ",
639 "One keyword, one not, back to back: "
640 "$Author$Rev: ", rev
, " $.",
643 apr_pstrcat(pool
, "$Author$Rev: ", rev
, " $.", NULL
);
645 /* Else Lines 48, 49, and 70 remain unchanged. */
647 else if ((! rev
) && author
)
652 apr_pstrcat(pool
, "Line 48: ",
653 "Two keywords back to back: "
654 "$Author: ", author
, " $$Rev$.",
657 apr_pstrcat(pool
, "Line 49: ",
658 "One keyword, one not, back to back: "
659 "$Author: ", author
, " $Rev$.",
662 apr_pstrcat(pool
, "$Author: ", author
, " $Rev$.", NULL
);
664 /* Else Lines 48, 49, and 70 remain unchanged. */
666 /* Else neither rev nor author, so Lines 48, 49, and 70 remain
669 /* Handle line 24 specially, as it contains two valid keywords. */
675 apr_pstrcat(pool
, "Line 24: ",
676 "keyword in a keyword: $Author: ",
684 apr_pstrcat(pool
, "Line 24: ",
685 "keyword in a keyword: $Author$Date$ $",
689 else if (date
&& (! author
))
694 apr_pstrcat(pool
, "Line 24: ",
695 "keyword in a keyword: $Author: $Date: ",
700 /* Else Line 24 remains unchanged. */
702 else if ((! date
) && author
)
707 apr_pstrcat(pool
, "Line 24: ",
708 "keyword in a keyword: $Author: ",
716 apr_pstrcat(pool
, "Line 24: ",
717 "keyword in a keyword: $Author$Date$ $",
721 /* Else neither author nor date, so Line 24 remains unchanged. */
723 /** Ready to verify. **/
725 SVN_ERR(svn_stringbuf_from_file(&contents
, dst_fname
, pool
));
727 for (i
= 0; i
< (sizeof(expect
) / sizeof(*expect
)); i
++)
729 if (contents
->len
< idx
)
730 return svn_error_createf
731 (SVN_ERR_MALFORMED_FILE
, NULL
,
732 "'%s' has short contents at line %" APR_SIZE_T_FMT
,
735 if (strncmp(contents
->data
+ idx
, expect
[i
], strlen(expect
[i
])) != 0)
736 return svn_error_createf
737 (SVN_ERR_MALFORMED_FILE
, NULL
,
738 "'%s' has wrong contents at line %" APR_SIZE_T_FMT
,
741 /* Else, the data is correct, at least up to the next eol. */
743 idx
+= strlen(expect
[i
]);
745 if (dst_eol
) /* verify the promised consistent eol style */
747 if (strncmp(contents
->data
+ idx
, dst_eol
, strlen(dst_eol
)) != 0)
748 return svn_error_createf
749 (SVN_ERR_IO_UNKNOWN_EOL
, NULL
,
750 "'%s' has wrong eol style at line %" APR_SIZE_T_FMT
, dst_fname
,
753 idx
+= strlen(dst_eol
);
755 else /* allow any eol style, even inconsistent ones, loosely */
757 while ((*(contents
->data
+ idx
) == '\r')
758 || (*(contents
->data
+ idx
) == '\n'))
763 /* Clean up this test, since successful. */
764 SVN_ERR(remove_file(src_fname
, pool
));
765 SVN_ERR(remove_file(dst_fname
, pool
));
773 noop(const char **msg
,
774 svn_boolean_t msg_only
,
775 svn_test_opts_t
*opts
,
778 *msg
= "no conversions";
783 SVN_ERR(substitute_and_verify
784 ("noop", NULL
, NULL
, 0, NULL
, NULL
, NULL
, NULL
, 1, pool
));
786 SVN_ERR(substitute_and_verify
787 ("noop", "\r", NULL
, 0, NULL
, NULL
, NULL
, NULL
, 1, pool
));
789 SVN_ERR(substitute_and_verify
790 ("noop", "\n", NULL
, 0, NULL
, NULL
, NULL
, NULL
, 1, pool
));
792 SVN_ERR(substitute_and_verify
793 ("noop", "\r\n", NULL
, 0, NULL
, NULL
, NULL
, NULL
, 1, pool
));
801 /** EOL conversion alone. **/
804 crlf_to_crlf(const char **msg
,
805 svn_boolean_t msg_only
,
806 svn_test_opts_t
*opts
,
809 *msg
= "convert CRLF to CRLF";
814 SVN_ERR(substitute_and_verify
815 ("crlf_to_crlf", "\r\n", "\r\n", 0,
816 NULL
, NULL
, NULL
, NULL
, 1, pool
));
823 lf_to_crlf(const char **msg
,
824 svn_boolean_t msg_only
,
825 svn_test_opts_t
*opts
,
828 *msg
= "convert LF to CRLF";
833 SVN_ERR(substitute_and_verify
834 ("lf_to_crlf", "\n", "\r\n", 0, NULL
, NULL
, NULL
, NULL
, 1, pool
));
841 cr_to_crlf(const char **msg
,
842 svn_boolean_t msg_only
,
843 svn_test_opts_t
*opts
,
846 *msg
= "convert CR to CRLF";
851 SVN_ERR(substitute_and_verify
852 ("cr_to_crlf", "\r", "\r\n", 0, NULL
, NULL
, NULL
, NULL
, 1, pool
));
859 mixed_to_crlf(const char **msg
,
860 svn_boolean_t msg_only
,
861 svn_test_opts_t
*opts
,
864 *msg
= "convert mixed line endings to CRLF";
869 SVN_ERR(substitute_and_verify
870 ("mixed_to_crlf", NULL
, "\r\n", 1,
871 NULL
, NULL
, NULL
, NULL
, 1, pool
));
878 lf_to_lf(const char **msg
,
879 svn_boolean_t msg_only
,
880 svn_test_opts_t
*opts
,
883 *msg
= "convert LF to LF";
888 SVN_ERR(substitute_and_verify
889 ("lf_to_lf", "\n", "\n", 0, NULL
, NULL
, NULL
, NULL
, 1, pool
));
896 crlf_to_lf(const char **msg
,
897 svn_boolean_t msg_only
,
898 svn_test_opts_t
*opts
,
901 *msg
= "convert CRLF to LF";
906 SVN_ERR(substitute_and_verify
907 ("crlf_to_lf", "\r\n", "\n", 0, NULL
, NULL
, NULL
, NULL
, 1, pool
));
914 cr_to_lf(const char **msg
,
915 svn_boolean_t msg_only
,
916 svn_test_opts_t
*opts
,
919 *msg
= "convert CR to LF";
924 SVN_ERR(substitute_and_verify
925 ("cr_to_lf", "\r", "\n", 0, NULL
, NULL
, NULL
, NULL
, 1, pool
));
932 mixed_to_lf(const char **msg
,
933 svn_boolean_t msg_only
,
934 svn_test_opts_t
*opts
,
937 *msg
= "convert mixed line endings to LF";
942 SVN_ERR(substitute_and_verify
943 ("cr_to_lf", NULL
, "\n", 1, NULL
, NULL
, NULL
, NULL
, 1, pool
));
950 crlf_to_cr(const char **msg
,
951 svn_boolean_t msg_only
,
952 svn_test_opts_t
*opts
,
955 *msg
= "convert CRLF to CR";
960 SVN_ERR(substitute_and_verify
961 ("crlf_to_cr", "\r\n", "\r", 0, NULL
, NULL
, NULL
, NULL
, 1, pool
));
968 lf_to_cr(const char **msg
,
969 svn_boolean_t msg_only
,
970 svn_test_opts_t
*opts
,
973 *msg
= "convert LF to CR";
978 SVN_ERR(substitute_and_verify
979 ("lf_to_cr", "\n", "\r", 0, NULL
, NULL
, NULL
, NULL
, 1, pool
));
986 cr_to_cr(const char **msg
,
987 svn_boolean_t msg_only
,
988 svn_test_opts_t
*opts
,
991 *msg
= "convert CR to CR";
996 SVN_ERR(substitute_and_verify
997 ("cr_to_cr", "\r", "\r", 0, NULL
, NULL
, NULL
, NULL
, 1, pool
));
1003 static svn_error_t
*
1004 mixed_to_cr(const char **msg
,
1005 svn_boolean_t msg_only
,
1006 svn_test_opts_t
*opts
,
1009 *msg
= "convert mixed line endings to CR";
1012 return SVN_NO_ERROR
;
1014 SVN_ERR(substitute_and_verify
1015 ("mixed_to_cr", NULL
, "\r", 1, NULL
, NULL
, NULL
, NULL
, 1, pool
));
1017 return SVN_NO_ERROR
;
1021 static svn_error_t
*
1022 mixed_no_repair(const char **msg
,
1023 svn_boolean_t msg_only
,
1024 svn_test_opts_t
*opts
,
1027 *msg
= "keep mixed line endings without repair flag";
1030 return SVN_NO_ERROR
;
1032 SVN_ERR(substitute_and_verify
1033 ("mixed_no_repair", NULL
, "\n", 0,
1034 NULL
, NULL
, NULL
, NULL
, 1, pool
));
1036 SVN_ERR(substitute_and_verify
1037 ("mixed_no_repair", NULL
, "\r\n", 0,
1038 NULL
, NULL
, NULL
, NULL
, 1, pool
));
1040 return SVN_NO_ERROR
;
1045 /** Keyword expansion alone. **/
1047 static svn_error_t
*
1048 expand_author(const char **msg
,
1049 svn_boolean_t msg_only
,
1050 svn_test_opts_t
*opts
,
1053 *msg
= "expand author";
1056 return SVN_NO_ERROR
;
1058 SVN_ERR(substitute_and_verify
1059 ("author", "\n", NULL
, 0, NULL
, NULL
, "jrandom", NULL
, 1, pool
));
1061 SVN_ERR(substitute_and_verify
1062 ("author", "\r\n", NULL
, 0, NULL
, NULL
, "jrandom", NULL
, 1, pool
));
1064 return SVN_NO_ERROR
;
1068 static svn_error_t
*
1069 expand_date(const char **msg
,
1070 svn_boolean_t msg_only
,
1071 svn_test_opts_t
*opts
,
1074 *msg
= "expand date";
1077 return SVN_NO_ERROR
;
1079 SVN_ERR(substitute_and_verify
1080 ("date", "\n", NULL
, 0,
1081 NULL
, "Wed Jan 9 07:49:05 2002", NULL
, NULL
, 1, pool
));
1083 SVN_ERR(substitute_and_verify
1084 ("date", "\r\n", NULL
, 0,
1085 NULL
, "Wed Jan 9 07:49:05 2002", NULL
, NULL
, 1, pool
));
1087 return SVN_NO_ERROR
;
1091 static svn_error_t
*
1092 expand_author_date(const char **msg
,
1093 svn_boolean_t msg_only
,
1094 svn_test_opts_t
*opts
,
1097 *msg
= "expand author and date";
1100 return SVN_NO_ERROR
;
1102 SVN_ERR(substitute_and_verify
1103 ("author_date", "\n", NULL
, 0,
1104 NULL
, "Wed Jan 9 07:49:05 2002", "jrandom", NULL
, 1, pool
));
1106 SVN_ERR(substitute_and_verify
1107 ("author_date", "\r\n", NULL
, 0,
1108 NULL
, "Wed Jan 9 07:49:05 2002", "jrandom", NULL
, 1, pool
));
1110 return SVN_NO_ERROR
;
1114 static svn_error_t
*
1115 expand_author_rev(const char **msg
,
1116 svn_boolean_t msg_only
,
1117 svn_test_opts_t
*opts
,
1120 *msg
= "expand author and rev";
1123 return SVN_NO_ERROR
;
1125 SVN_ERR(substitute_and_verify
1126 ("author_rev", "\n", NULL
, 0,
1127 "1729", NULL
, "jrandom", NULL
, 1, pool
));
1129 SVN_ERR(substitute_and_verify
1130 ("author_rev", "\r\n", NULL
, 0,
1131 "1729", NULL
, "jrandom", NULL
, 1, pool
));
1133 return SVN_NO_ERROR
;
1137 static svn_error_t
*
1138 expand_rev(const char **msg
,
1139 svn_boolean_t msg_only
,
1140 svn_test_opts_t
*opts
,
1143 *msg
= "expand rev";
1146 return SVN_NO_ERROR
;
1148 SVN_ERR(substitute_and_verify
1149 ("rev", "\n", NULL
, 0,
1150 "1729", NULL
, NULL
, NULL
, 1, pool
));
1152 SVN_ERR(substitute_and_verify
1153 ("rev", "\r\n", NULL
, 0,
1154 "1729", NULL
, NULL
, NULL
, 1, pool
));
1156 return SVN_NO_ERROR
;
1160 static svn_error_t
*
1161 expand_rev_url(const char **msg
,
1162 svn_boolean_t msg_only
,
1163 svn_test_opts_t
*opts
,
1166 *msg
= "expand rev and url";
1169 return SVN_NO_ERROR
;
1171 SVN_ERR(substitute_and_verify
1172 ("rev_url", "\n", NULL
, 0,
1173 "1729", NULL
, NULL
, "http://subversion.tigris.org", 1, pool
));
1175 SVN_ERR(substitute_and_verify
1176 ("rev_url", "\r\n", NULL
, 0,
1177 "1729", NULL
, NULL
, "http://subversion.tigris.org", 1, pool
));
1179 return SVN_NO_ERROR
;
1183 static svn_error_t
*
1184 expand_author_date_rev_url(const char **msg
,
1185 svn_boolean_t msg_only
,
1186 svn_test_opts_t
*opts
,
1189 *msg
= "expand author, date, rev, and url";
1192 return SVN_NO_ERROR
;
1194 SVN_ERR(substitute_and_verify
1195 ("author_date_rev_url", "\n", NULL
, 0,
1197 "Wed Jan 9 07:49:05 2002",
1199 "http://subversion.tigris.org",
1202 SVN_ERR(substitute_and_verify
1203 ("author_date_rev_url", "\r\n", NULL
, 0,
1205 "Wed Jan 9 07:49:05 2002",
1207 "http://subversion.tigris.org",
1210 return SVN_NO_ERROR
;
1215 /** Keyword expansion and EOL conversion together. **/
1217 static svn_error_t
*
1218 lf_to_crlf_expand_author(const char **msg
,
1219 svn_boolean_t msg_only
,
1220 svn_test_opts_t
*opts
,
1223 *msg
= "lf_to_crlf; expand author";
1226 return SVN_NO_ERROR
;
1228 SVN_ERR(substitute_and_verify
1229 ("lf_to_crlf_author", "\n", "\r\n", 0,
1230 NULL
, NULL
, "jrandom", NULL
, 1, pool
));
1232 return SVN_NO_ERROR
;
1236 static svn_error_t
*
1237 mixed_to_lf_expand_author_date(const char **msg
,
1238 svn_boolean_t msg_only
,
1239 svn_test_opts_t
*opts
,
1242 *msg
= "mixed_to_lf; expand author and date";
1245 return SVN_NO_ERROR
;
1247 SVN_ERR(substitute_and_verify
1248 ("mixed_to_lf_author_date", NULL
, "\n", 1,
1249 NULL
, "Wed Jan 9 07:49:05 2002", "jrandom", NULL
, 1, pool
));
1251 return SVN_NO_ERROR
;
1255 static svn_error_t
*
1256 crlf_to_cr_expand_author_rev(const char **msg
,
1257 svn_boolean_t msg_only
,
1258 svn_test_opts_t
*opts
,
1261 *msg
= "crlf_to_cr; expand author and rev";
1264 return SVN_NO_ERROR
;
1266 SVN_ERR(substitute_and_verify
1267 ("crlf_to_cr_author_rev", "\r\n", "\r", 0,
1268 "1729", NULL
, "jrandom", NULL
, 1, pool
));
1270 return SVN_NO_ERROR
;
1274 static svn_error_t
*
1275 cr_to_crlf_expand_rev(const char **msg
,
1276 svn_boolean_t msg_only
,
1277 svn_test_opts_t
*opts
,
1280 *msg
= "cr_to_crlf; expand rev";
1283 return SVN_NO_ERROR
;
1285 SVN_ERR(substitute_and_verify
1286 ("cr_to_crlf_rev", "\r", "\r\n", 0,
1287 "1729", NULL
, NULL
, NULL
, 1, pool
));
1289 return SVN_NO_ERROR
;
1293 static svn_error_t
*
1294 cr_to_crlf_expand_rev_url(const char **msg
,
1295 svn_boolean_t msg_only
,
1296 svn_test_opts_t
*opts
,
1299 *msg
= "cr_to_crlf; expand rev and url";
1302 return SVN_NO_ERROR
;
1304 SVN_ERR(substitute_and_verify
1305 ("cr_to_crlf_rev_url", "\r", "\r\n", 0,
1306 "1729", NULL
, NULL
, "http://subversion.tigris.org", 1, pool
));
1308 return SVN_NO_ERROR
;
1312 static svn_error_t
*
1313 mixed_to_crlf_expand_author_date_rev_url(const char **msg
,
1314 svn_boolean_t msg_only
,
1315 svn_test_opts_t
*opts
,
1318 *msg
= "mixed_to_crlf; expand author, date, rev, and url";
1321 return SVN_NO_ERROR
;
1323 SVN_ERR(substitute_and_verify
1324 ("mixed_to_crlf_author_date_rev_url", NULL
, "\r\n", 1,
1326 "Wed Jan 9 07:49:05 2002",
1328 "http://subversion.tigris.org",
1332 return SVN_NO_ERROR
;
1337 /** Keyword unexpansion alone. **/
1339 static svn_error_t
*
1340 unexpand_author(const char **msg
,
1341 svn_boolean_t msg_only
,
1342 svn_test_opts_t
*opts
,
1345 *msg
= "unexpand author";
1348 return SVN_NO_ERROR
;
1350 SVN_ERR(substitute_and_verify
1351 ("author", "\n", NULL
, 0, NULL
, NULL
, "jrandom", NULL
, 0, pool
));
1353 SVN_ERR(substitute_and_verify
1354 ("author", "\r\n", NULL
, 0, NULL
, NULL
, "jrandom", NULL
, 0, pool
));
1356 return SVN_NO_ERROR
;
1360 static svn_error_t
*
1361 unexpand_date(const char **msg
,
1362 svn_boolean_t msg_only
,
1363 svn_test_opts_t
*opts
,
1366 *msg
= "unexpand date";
1369 return SVN_NO_ERROR
;
1371 SVN_ERR(substitute_and_verify
1372 ("date", "\n", NULL
, 0,
1373 NULL
, "Wed Jan 9 07:49:05 2002", NULL
, NULL
, 0, pool
));
1375 SVN_ERR(substitute_and_verify
1376 ("date", "\r\n", NULL
, 0,
1377 NULL
, "Wed Jan 9 07:49:05 2002", NULL
, NULL
, 0, pool
));
1379 return SVN_NO_ERROR
;
1383 static svn_error_t
*
1384 unexpand_author_date(const char **msg
,
1385 svn_boolean_t msg_only
,
1386 svn_test_opts_t
*opts
,
1389 *msg
= "unexpand author and date";
1392 return SVN_NO_ERROR
;
1394 SVN_ERR(substitute_and_verify
1395 ("author_date", "\n", NULL
, 0,
1396 NULL
, "Wed Jan 9 07:49:05 2002", "jrandom", NULL
, 0, pool
));
1398 SVN_ERR(substitute_and_verify
1399 ("author_date", "\r\n", NULL
, 0,
1400 NULL
, "Wed Jan 9 07:49:05 2002", "jrandom", NULL
, 0, pool
));
1402 return SVN_NO_ERROR
;
1406 static svn_error_t
*
1407 unexpand_author_rev(const char **msg
,
1408 svn_boolean_t msg_only
,
1409 svn_test_opts_t
*opts
,
1412 *msg
= "unexpand author and rev";
1415 return SVN_NO_ERROR
;
1417 SVN_ERR(substitute_and_verify
1418 ("author_rev", "\n", NULL
, 0,
1419 "1729", NULL
, "jrandom", NULL
, 0, pool
));
1421 SVN_ERR(substitute_and_verify
1422 ("author_rev", "\r\n", NULL
, 0,
1423 "1729", NULL
, "jrandom", NULL
, 0, pool
));
1425 return SVN_NO_ERROR
;
1429 static svn_error_t
*
1430 unexpand_rev(const char **msg
,
1431 svn_boolean_t msg_only
,
1432 svn_test_opts_t
*opts
,
1435 *msg
= "unexpand rev";
1438 return SVN_NO_ERROR
;
1440 SVN_ERR(substitute_and_verify
1441 ("rev", "\n", NULL
, 0,
1442 "1729", NULL
, NULL
, NULL
, 0, pool
));
1444 SVN_ERR(substitute_and_verify
1445 ("rev", "\r\n", NULL
, 0,
1446 "1729", NULL
, NULL
, NULL
, 0, pool
));
1448 return SVN_NO_ERROR
;
1452 static svn_error_t
*
1453 unexpand_rev_url(const char **msg
,
1454 svn_boolean_t msg_only
,
1455 svn_test_opts_t
*opts
,
1458 *msg
= "unexpand rev and url";
1461 return SVN_NO_ERROR
;
1463 SVN_ERR(substitute_and_verify
1464 ("rev_url", "\n", NULL
, 0,
1465 "1729", NULL
, NULL
, "http://subversion.tigris.org", 0, pool
));
1467 SVN_ERR(substitute_and_verify
1468 ("rev_url", "\r\n", NULL
, 0,
1469 "1729", NULL
, NULL
, "http://subversion.tigris.org", 0, pool
));
1471 return SVN_NO_ERROR
;
1475 static svn_error_t
*
1476 unexpand_author_date_rev_url(const char **msg
,
1477 svn_boolean_t msg_only
,
1478 svn_test_opts_t
*opts
,
1481 *msg
= "unexpand author, date, rev, and url";
1484 return SVN_NO_ERROR
;
1486 SVN_ERR(substitute_and_verify
1487 ("author_date_rev_url", "\n", NULL
, 0,
1489 "Wed Jan 9 07:49:05 2002",
1491 "http://subversion.tigris.org",
1494 SVN_ERR(substitute_and_verify
1495 ("author_date_rev_url", "\r\n", NULL
, 0,
1497 "Wed Jan 9 07:49:05 2002",
1499 "http://subversion.tigris.org",
1502 return SVN_NO_ERROR
;
1507 /** Keyword unexpansion and EOL conversion together. **/
1509 static svn_error_t
*
1510 lf_to_crlf_unexpand_author(const char **msg
,
1511 svn_boolean_t msg_only
,
1512 svn_test_opts_t
*opts
,
1515 *msg
= "lf_to_crlf; unexpand author";
1518 return SVN_NO_ERROR
;
1520 SVN_ERR(substitute_and_verify
1521 ("lf_to_crlf_author", "\n", "\r\n", 0,
1522 NULL
, NULL
, "jrandom", NULL
, 0, pool
));
1524 return SVN_NO_ERROR
;
1528 static svn_error_t
*
1529 mixed_to_lf_unexpand_author_date(const char **msg
,
1530 svn_boolean_t msg_only
,
1531 svn_test_opts_t
*opts
,
1534 *msg
= "mixed_to_lf; unexpand author and date";
1537 return SVN_NO_ERROR
;
1539 SVN_ERR(substitute_and_verify
1540 ("mixed_to_lf_author_date", NULL
, "\n", 1,
1541 NULL
, "Wed Jan 9 07:49:05 2002", "jrandom", NULL
, 0, pool
));
1543 return SVN_NO_ERROR
;
1547 static svn_error_t
*
1548 crlf_to_cr_unexpand_author_rev(const char **msg
,
1549 svn_boolean_t msg_only
,
1550 svn_test_opts_t
*opts
,
1553 *msg
= "crlf_to_cr; unexpand author and rev";
1556 return SVN_NO_ERROR
;
1558 SVN_ERR(substitute_and_verify
1559 ("crlf_to_cr_author_rev", "\r\n", "\r", 0,
1560 "1729", NULL
, "jrandom", NULL
, 0, pool
));
1562 return SVN_NO_ERROR
;
1566 static svn_error_t
*
1567 cr_to_crlf_unexpand_rev(const char **msg
,
1568 svn_boolean_t msg_only
,
1569 svn_test_opts_t
*opts
,
1572 *msg
= "cr_to_crlf; unexpand rev";
1575 return SVN_NO_ERROR
;
1577 SVN_ERR(substitute_and_verify
1578 ("cr_to_crlf_rev", "\r", "\r\n", 0,
1579 "1729", NULL
, NULL
, NULL
, 0, pool
));
1581 return SVN_NO_ERROR
;
1585 static svn_error_t
*
1586 cr_to_crlf_unexpand_rev_url(const char **msg
,
1587 svn_boolean_t msg_only
,
1588 svn_test_opts_t
*opts
,
1591 *msg
= "cr_to_crlf; unexpand rev and url";
1594 return SVN_NO_ERROR
;
1596 SVN_ERR(substitute_and_verify
1597 ("cr_to_crlf_rev_url", "\r", "\r\n", 0,
1598 "1729", NULL
, NULL
, "http://subversion.tigris.org", 0, pool
));
1600 return SVN_NO_ERROR
;
1604 static svn_error_t
*
1605 mixed_to_crlf_unexpand_author_date_rev_url(const char **msg
,
1606 svn_boolean_t msg_only
,
1607 svn_test_opts_t
*opts
,
1610 *msg
= "mixed_to_crlf; unexpand author, date, rev, url";
1613 return SVN_NO_ERROR
;
1615 SVN_ERR(substitute_and_verify
1616 ("mixed_to_crlf_author_date_rev_url", NULL
, "\r\n", 1,
1618 "Wed Jan 9 07:49:05 2002",
1620 "http://subversion.tigris.org",
1624 return SVN_NO_ERROR
;
1629 /* The test table. */
1631 struct svn_test_descriptor_t test_funcs
[] =
1634 /* The no-op conversion. */
1635 SVN_TEST_PASS(noop
),
1636 /* Conversions resulting in crlf, no keywords involved. */
1637 SVN_TEST_PASS(crlf_to_crlf
),
1638 SVN_TEST_PASS(lf_to_crlf
),
1639 SVN_TEST_PASS(cr_to_crlf
),
1640 SVN_TEST_PASS(mixed_to_crlf
),
1641 /* Conversions resulting in lf, no keywords involved. */
1642 SVN_TEST_PASS(lf_to_lf
),
1643 SVN_TEST_PASS(crlf_to_lf
),
1644 SVN_TEST_PASS(cr_to_lf
),
1645 SVN_TEST_PASS(mixed_to_lf
),
1646 /* Conversions resulting in cr, no keywords involved. */
1647 SVN_TEST_PASS(crlf_to_cr
),
1648 SVN_TEST_PASS(lf_to_cr
),
1649 SVN_TEST_PASS(cr_to_cr
),
1650 SVN_TEST_PASS(mixed_to_cr
),
1651 /* Random eol stuff. */
1652 SVN_TEST_PASS(mixed_no_repair
),
1653 /* Keyword expansion alone, no eol conversion involved. */
1654 SVN_TEST_PASS(expand_author
),
1655 SVN_TEST_PASS(expand_date
),
1656 SVN_TEST_PASS(expand_author_date
),
1657 SVN_TEST_PASS(expand_author_rev
),
1658 SVN_TEST_PASS(expand_rev
),
1659 SVN_TEST_PASS(expand_rev_url
),
1660 SVN_TEST_PASS(expand_author_date_rev_url
),
1661 /* Keyword expansion and eol conversion together. */
1662 SVN_TEST_PASS(lf_to_crlf_expand_author
),
1663 SVN_TEST_PASS(mixed_to_lf_expand_author_date
),
1664 SVN_TEST_PASS(crlf_to_cr_expand_author_rev
),
1665 SVN_TEST_PASS(cr_to_crlf_expand_rev
),
1666 SVN_TEST_PASS(cr_to_crlf_expand_rev_url
),
1667 SVN_TEST_PASS(mixed_to_crlf_expand_author_date_rev_url
),
1668 /* Keyword unexpansion alone, no eol conversion involved. */
1669 SVN_TEST_PASS(unexpand_author
),
1670 SVN_TEST_PASS(unexpand_date
),
1671 SVN_TEST_PASS(unexpand_author_date
),
1672 SVN_TEST_PASS(unexpand_author_rev
),
1673 SVN_TEST_PASS(unexpand_rev
),
1674 SVN_TEST_PASS(unexpand_rev_url
),
1675 SVN_TEST_PASS(unexpand_author_date_rev_url
),
1676 /* Keyword unexpansion and eol conversion together. */
1677 SVN_TEST_PASS(lf_to_crlf_unexpand_author
),
1678 SVN_TEST_PASS(mixed_to_lf_unexpand_author_date
),
1679 SVN_TEST_PASS(crlf_to_cr_unexpand_author_rev
),
1680 SVN_TEST_PASS(cr_to_crlf_unexpand_rev
),
1681 SVN_TEST_PASS(cr_to_crlf_unexpand_rev_url
),
1682 SVN_TEST_PASS(mixed_to_crlf_unexpand_author_date_rev_url
),