cli: Use clearer format for string literals
Update the string literals in `rad patch` to use an easier to read format.
This commit is contained in:
parent
92648f934e
commit
6bbdc574f0
|
|
@ -337,67 +337,64 @@ mod test {
|
||||||
|
|
||||||
let res = create_display_message(&repo, &commit_0, &commit_0).unwrap();
|
let res = create_display_message(&repo, &commit_0, &commit_0).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
r#"
|
"\
|
||||||
<!--
|
<!--\n\
|
||||||
Please enter a patch message for your changes. An empty
|
Please enter a patch message for your changes. An empty\n\
|
||||||
message aborts the patch proposal.
|
message aborts the patch proposal.\n\
|
||||||
|
\n\
|
||||||
The first line is the patch title. The patch description
|
The first line is the patch title. The patch description\n\
|
||||||
follows, and must be separated with a blank line, just
|
follows, and must be separated with a blank line, just\n\
|
||||||
like a commit message. Markdown is supported in the title
|
like a commit message. Markdown is supported in the title\n\
|
||||||
and description.
|
and description.\n\
|
||||||
-->
|
-->\n\
|
||||||
"#
|
",
|
||||||
.trim_start(),
|
|
||||||
res
|
res
|
||||||
);
|
);
|
||||||
|
|
||||||
let res = create_display_message(&repo, &commit_0, &commit_1).unwrap();
|
let res = create_display_message(&repo, &commit_0, &commit_1).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
r#"
|
"\
|
||||||
commit 1
|
commit 1\n\
|
||||||
|
\n\
|
||||||
<!--
|
<!--\n\
|
||||||
Please enter a patch message for your changes. An empty
|
Please enter a patch message for your changes. An empty\n\
|
||||||
message aborts the patch proposal.
|
message aborts the patch proposal.\n\
|
||||||
|
\n\
|
||||||
The first line is the patch title. The patch description
|
The first line is the patch title. The patch description\n\
|
||||||
follows, and must be separated with a blank line, just
|
follows, and must be separated with a blank line, just\n\
|
||||||
like a commit message. Markdown is supported in the title
|
like a commit message. Markdown is supported in the title\n\
|
||||||
and description.
|
and description.\n\
|
||||||
-->
|
-->\n\
|
||||||
"#
|
",
|
||||||
.trim_start(),
|
|
||||||
res
|
res
|
||||||
);
|
);
|
||||||
|
|
||||||
let res = create_display_message(&repo, &commit_0, &commit_2).unwrap();
|
let res = create_display_message(&repo, &commit_0, &commit_2).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
r#"
|
"\
|
||||||
<!--
|
<!--\n\
|
||||||
This patch is the combination of 2 commits.
|
This patch is the combination of 2 commits.\n\
|
||||||
This is the first commit message:
|
This is the first commit message:\n\
|
||||||
-->
|
-->\n\
|
||||||
|
\n\
|
||||||
commit 1
|
commit 1\n\
|
||||||
|
\n\
|
||||||
<!--
|
<!--\n\
|
||||||
This is commit message #2:
|
This is commit message #2:\n\
|
||||||
-->
|
-->\n\
|
||||||
|
\n\
|
||||||
commit 2
|
commit 2\n\
|
||||||
|
\n\
|
||||||
<!--
|
<!--\n\
|
||||||
Please enter a patch message for your changes. An empty
|
Please enter a patch message for your changes. An empty\n\
|
||||||
message aborts the patch proposal.
|
message aborts the patch proposal.\n\
|
||||||
|
\n\
|
||||||
The first line is the patch title. The patch description
|
The first line is the patch title. The patch description\n\
|
||||||
follows, and must be separated with a blank line, just
|
follows, and must be separated with a blank line, just\n\
|
||||||
like a commit message. Markdown is supported in the title
|
like a commit message. Markdown is supported in the title\n\
|
||||||
and description.
|
and description.\n\
|
||||||
-->
|
-->\n\
|
||||||
"#
|
",
|
||||||
.trim_start(),
|
|
||||||
res
|
res
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -406,22 +403,21 @@ and description.
|
||||||
fn test_edit_display_message() {
|
fn test_edit_display_message() {
|
||||||
let res = edit_display_message("title", "The patch description.");
|
let res = edit_display_message("title", "The patch description.");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
r#"
|
"\
|
||||||
title
|
title\n\
|
||||||
|
\n\
|
||||||
The patch description.
|
The patch description.\n\
|
||||||
|
\n\
|
||||||
<!--
|
<!--\n\
|
||||||
Please enter a patch message for your changes. An empty
|
Please enter a patch message for your changes. An empty\n\
|
||||||
message aborts the patch proposal.
|
message aborts the patch proposal.\n\
|
||||||
|
\n\
|
||||||
The first line is the patch title. The patch description
|
The first line is the patch title. The patch description\n\
|
||||||
follows, and must be separated with a blank line, just
|
follows, and must be separated with a blank line, just\n\
|
||||||
like a commit message. Markdown is supported in the title
|
like a commit message. Markdown is supported in the title\n\
|
||||||
and description.
|
and description.\n\
|
||||||
-->
|
-->\n\
|
||||||
"#
|
",
|
||||||
.trim_start(),
|
|
||||||
res
|
res
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -443,39 +439,36 @@ and description.
|
||||||
|
|
||||||
let res = update_display_message(&repo, &commit_1, &commit_1).unwrap();
|
let res = update_display_message(&repo, &commit_1, &commit_1).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
r#"
|
"\
|
||||||
<!--
|
<!--\n\
|
||||||
Please enter a comment for your patch update. Leaving this
|
Please enter a comment for your patch update. Leaving this\n\
|
||||||
blank is also okay.
|
blank is also okay.\n\
|
||||||
-->
|
-->\n\
|
||||||
"#
|
",
|
||||||
.trim_start(),
|
|
||||||
res
|
res
|
||||||
);
|
);
|
||||||
|
|
||||||
let res = update_display_message(&repo, &commit_1, &commit_2).unwrap();
|
let res = update_display_message(&repo, &commit_1, &commit_2).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
r#"
|
"\
|
||||||
commit 2
|
commit 2\n\
|
||||||
|
\n\
|
||||||
<!--
|
<!--\n\
|
||||||
Please enter a comment for your patch update. Leaving this
|
Please enter a comment for your patch update. Leaving this\n\
|
||||||
blank is also okay.
|
blank is also okay.\n\
|
||||||
-->
|
-->\n\
|
||||||
"#
|
",
|
||||||
.trim_start(),
|
|
||||||
res
|
res
|
||||||
);
|
);
|
||||||
|
|
||||||
let res = update_display_message(&repo, &commit_1, &commit_squashed).unwrap();
|
let res = update_display_message(&repo, &commit_1, &commit_squashed).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
r#"
|
"\
|
||||||
<!--
|
<!--\n\
|
||||||
Please enter a comment for your patch update. Leaving this
|
Please enter a comment for your patch update. Leaving this\n\
|
||||||
blank is also okay.
|
blank is also okay.\n\
|
||||||
-->
|
-->\n\
|
||||||
"#
|
",
|
||||||
.trim_start(),
|
|
||||||
res
|
res
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue