📄 translate-test.c
字号:
"1729", NULL, NULL, NULL, 1, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
expand_rev_url (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "expand rev and url";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("rev_url", "\n", NULL, 0,
"1729", NULL, NULL, "http://subversion.tigris.org", 1, pool));
SVN_ERR (substitute_and_verify
("rev_url", "\r\n", NULL, 0,
"1729", NULL, NULL, "http://subversion.tigris.org", 1, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
expand_author_date_rev_url (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "expand author, date, rev, and url";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("author_date_rev_url", "\n", NULL, 0,
"1729",
"Wed Jan 9 07:49:05 2002",
"jrandom",
"http://subversion.tigris.org",
1, pool));
SVN_ERR (substitute_and_verify
("author_date_rev_url", "\r\n", NULL, 0,
"1729",
"Wed Jan 9 07:49:05 2002",
"jrandom",
"http://subversion.tigris.org",
1, pool));
return SVN_NO_ERROR;
}
/** Keyword expansion and EOL conversion together. **/
static svn_error_t *
lf_to_crlf_expand_author (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "lf_to_crlf; expand author";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("lf_to_crlf_author", "\n", "\r\n", 0,
NULL, NULL, "jrandom", NULL, 1, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
mixed_to_lf_expand_author_date (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "mixed_to_lf; expand author and date";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("mixed_to_lf_author_date", NULL, "\n", 1,
NULL, "Wed Jan 9 07:49:05 2002", "jrandom", NULL, 1, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
crlf_to_cr_expand_author_rev (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "crlf_to_cr; expand author and rev";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("crlf_to_cr_author_rev", "\r\n", "\r", 0,
"1729", NULL, "jrandom", NULL, 1, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
cr_to_crlf_expand_rev (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "cr_to_crlf; expand rev";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("cr_to_crlf_rev", "\r", "\r\n", 0,
"1729", NULL, NULL, NULL, 1, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
cr_to_crlf_expand_rev_url (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "cr_to_crlf; expand rev and url";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("cr_to_crlf_rev_url", "\r", "\r\n", 0,
"1729", NULL, NULL, "http://subversion.tigris.org", 1, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
mixed_to_crlf_expand_author_date_rev_url (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "mixed_to_crlf; expand author, date, rev, and url";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("mixed_to_crlf_author_date_rev_url", NULL, "\r\n", 1,
"1729",
"Wed Jan 9 07:49:05 2002",
"jrandom",
"http://subversion.tigris.org",
1,
pool));
return SVN_NO_ERROR;
}
/** Keyword unexpansion alone. **/
static svn_error_t *
unexpand_author (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "unexpand author";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("author", "\n", NULL, 0, NULL, NULL, "jrandom", NULL, 0, pool));
SVN_ERR (substitute_and_verify
("author", "\r\n", NULL, 0, NULL, NULL, "jrandom", NULL, 0, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
unexpand_date (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "unexpand date";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("date", "\n", NULL, 0,
NULL, "Wed Jan 9 07:49:05 2002", NULL, NULL, 0, pool));
SVN_ERR (substitute_and_verify
("date", "\r\n", NULL, 0,
NULL, "Wed Jan 9 07:49:05 2002", NULL, NULL, 0, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
unexpand_author_date (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "unexpand author and date";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("author_date", "\n", NULL, 0,
NULL, "Wed Jan 9 07:49:05 2002", "jrandom", NULL, 0, pool));
SVN_ERR (substitute_and_verify
("author_date", "\r\n", NULL, 0,
NULL, "Wed Jan 9 07:49:05 2002", "jrandom", NULL, 0, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
unexpand_author_rev (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "unexpand author and rev";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("author_rev", "\n", NULL, 0,
"1729", NULL, "jrandom", NULL, 0, pool));
SVN_ERR (substitute_and_verify
("author_rev", "\r\n", NULL, 0,
"1729", NULL, "jrandom", NULL, 0, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
unexpand_rev (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "unexpand rev";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("rev", "\n", NULL, 0,
"1729", NULL, NULL, NULL, 0, pool));
SVN_ERR (substitute_and_verify
("rev", "\r\n", NULL, 0,
"1729", NULL, NULL, NULL, 0, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
unexpand_rev_url (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "unexpand rev and url";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("rev_url", "\n", NULL, 0,
"1729", NULL, NULL, "http://subversion.tigris.org", 0, pool));
SVN_ERR (substitute_and_verify
("rev_url", "\r\n", NULL, 0,
"1729", NULL, NULL, "http://subversion.tigris.org", 0, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
unexpand_author_date_rev_url (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "unexpand author, date, rev, and url";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("author_date_rev_url", "\n", NULL, 0,
"1729",
"Wed Jan 9 07:49:05 2002",
"jrandom",
"http://subversion.tigris.org",
1, pool));
SVN_ERR (substitute_and_verify
("author_date_rev_url", "\r\n", NULL, 0,
"1729",
"Wed Jan 9 07:49:05 2002",
"jrandom",
"http://subversion.tigris.org",
1, pool));
return SVN_NO_ERROR;
}
/** Keyword unexpansion and EOL conversion together. **/
static svn_error_t *
lf_to_crlf_unexpand_author (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "lf_to_crlf; unexpand author";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("lf_to_crlf_author", "\n", "\r\n", 0,
NULL, NULL, "jrandom", NULL, 0, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
mixed_to_lf_unexpand_author_date (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "mixed_to_lf; unexpand author and date";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("mixed_to_lf_author_date", NULL, "\n", 1,
NULL, "Wed Jan 9 07:49:05 2002", "jrandom", NULL, 0, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
crlf_to_cr_unexpand_author_rev (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "crlf_to_cr; unexpand author and rev";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("crlf_to_cr_author_rev", "\r\n", "\r", 0,
"1729", NULL, "jrandom", NULL, 0, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
cr_to_crlf_unexpand_rev (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "cr_to_crlf; unexpand rev";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("cr_to_crlf_rev", "\r", "\r\n", 0,
"1729", NULL, NULL, NULL, 0, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
cr_to_crlf_unexpand_rev_url (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "cr_to_crlf; unexpand rev and url";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("cr_to_crlf_rev_url", "\r", "\r\n", 0,
"1729", NULL, NULL, "http://subversion.tigris.org", 0, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
mixed_to_crlf_unexpand_author_date_rev_url (const char **msg,
svn_boolean_t msg_only,
apr_pool_t *pool)
{
*msg = "mixed_to_crlf; unexpand author, date, rev, url";
if (msg_only)
return SVN_NO_ERROR;
SVN_ERR (substitute_and_verify
("mixed_to_crlf_author_date_rev_url", NULL, "\r\n", 1,
"1729",
"Wed Jan 9 07:49:05 2002",
"jrandom",
"http://subversion.tigris.org",
0,
pool));
return SVN_NO_ERROR;
}
/* The test table. */
struct svn_test_descriptor_t test_funcs[] =
{
SVN_TEST_NULL,
/* The no-op conversion. */
SVN_TEST_PASS (noop),
/* Conversions resulting in crlf, no keywords involved. */
SVN_TEST_PASS (crlf_to_crlf),
SVN_TEST_PASS (lf_to_crlf),
SVN_TEST_PASS (cr_to_crlf),
SVN_TEST_PASS (mixed_to_crlf),
/* Conversions resulting in lf, no keywords involved. */
SVN_TEST_PASS (lf_to_lf),
SVN_TEST_PASS (crlf_to_lf),
SVN_TEST_PASS (cr_to_lf),
SVN_TEST_PASS (mixed_to_lf),
/* Conversions resulting in cr, no keywords involved. */
SVN_TEST_PASS (crlf_to_cr),
SVN_TEST_PASS (lf_to_cr),
SVN_TEST_PASS (cr_to_cr),
SVN_TEST_PASS (mixed_to_cr),
/* Random eol stuff. */
SVN_TEST_PASS (mixed_no_repair),
/* Keyword expansion alone, no eol conversion involved. */
SVN_TEST_PASS (expand_author),
SVN_TEST_PASS (expand_date),
SVN_TEST_PASS (expand_author_date),
SVN_TEST_PASS (expand_author_rev),
SVN_TEST_PASS (expand_rev),
SVN_TEST_PASS (expand_rev_url),
SVN_TEST_PASS (expand_author_date_rev_url),
/* Keyword expansion and eol conversion together. */
SVN_TEST_PASS (lf_to_crlf_expand_author),
SVN_TEST_PASS (mixed_to_lf_expand_author_date),
SVN_TEST_PASS (crlf_to_cr_expand_author_rev),
SVN_TEST_PASS (cr_to_crlf_expand_rev),
SVN_TEST_PASS (cr_to_crlf_expand_rev_url),
SVN_TEST_PASS (mixed_to_crlf_expand_author_date_rev_url),
/* Keyword unexpansion alone, no eol conversion involved. */
SVN_TEST_PASS (unexpand_author),
SVN_TEST_PASS (unexpand_date),
SVN_TEST_PASS (unexpand_author_date),
SVN_TEST_PASS (unexpand_author_rev),
SVN_TEST_PASS (unexpand_rev),
SVN_TEST_PASS (unexpand_rev_url),
SVN_TEST_PASS (unexpand_author_date_rev_url),
/* Keyword unexpansion and eol conversion together. */
SVN_TEST_PASS (lf_to_crlf_unexpand_author),
SVN_TEST_PASS (mixed_to_lf_unexpand_author_date),
SVN_TEST_PASS (crlf_to_cr_unexpand_author_rev),
SVN_TEST_PASS (cr_to_crlf_unexpand_rev),
SVN_TEST_PASS (cr_to_crlf_unexpand_rev_url),
SVN_TEST_PASS (mixed_to_crlf_unexpand_author_date_rev_url),
SVN_TEST_NULL
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -