Skip to content

Commit

Permalink
(DO NOT MERGE) Replace .upper() to use readable case instead of upp…
Browse files Browse the repository at this point in the history
…er case

This is for easier testing.
  • Loading branch information
ilyagr committed Jan 22, 2024
1 parent c848a20 commit a51b820
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions cli/src/commit_templater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,11 +696,11 @@ fn to_readable_case(s: &str) -> String {
impl ShortestIdPrefix {
fn to_upper(&self) -> Self {
Self {
prefix: self.prefix.to_ascii_uppercase(),
rest: self.rest.to_ascii_uppercase(),
// TODO: Undo this
prefix: to_readable_case(&self.prefix),
rest: to_readable_case(&self.rest),
}
}

fn to_readable(&self) -> Self {
Self {
prefix: to_readable_case(&self.prefix),
Expand Down
4 changes: 2 additions & 2 deletions cli/tests/test_commit_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,8 @@ fn test_log_customize_short_id() {
],
);
insta::assert_snapshot!(stdout, @r###"
@ QPVUNTSM [email protected] 2001-02-03 04:05:08.000 +07:00 69542c19
@ QpVuNtsm [email protected] 2001-02-03 04:05:08.000 +07:00 69542c19
│ (empty) first
ZZZZZZZZ root() 00000000
zzzzzzzz root() 00000000
"###);
}
2 changes: 1 addition & 1 deletion cli/tests/test_templater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn test_templater_upper_lower() {

insta::assert_snapshot!(
render(r#"change_id.shortest(4).upper() ++ change_id.shortest(4).upper().lower()"#),
@"[1m[38;5;5mZ[0m[38;5;8mZZZ[39m[1m[38;5;5mz[0m[38;5;8mzzz[39m");
@"[1m[38;5;5mz[0m[38;5;8mzzz[39m[1m[38;5;5mz[0m[38;5;8mzzz[39m");
insta::assert_snapshot!(
render(r#""Hello".upper() ++ "Hello".lower()"#), @"HELLOhello");
}
Expand Down

0 comments on commit a51b820

Please sign in to comment.