diff options
author | Michael Allen <michael@michaelallen.io> | 2015-09-17 11:52:15 +0100 |
---|---|---|
committer | Michael Allen <michael@michaelallen.io> | 2015-09-17 11:52:59 +0100 |
commit | 49d6fcc1190066b38d1684f1cfd1d4fea3190d78 (patch) | |
tree | 34653a97afa981d668e84e14df2c7a363dbf59ec /test | |
parent | 1731759cb2a16a3814d9784bae905250c46ce36b (diff) | |
download | git-sonar-49d6fcc1190066b38d1684f1cfd1d4fea3190d78.tar.gz git-sonar-49d6fcc1190066b38d1684f1cfd1d4fea3190d78.zip |
Switch local commits to use prefixes
Diffstat (limited to '')
-rwxr-xr-x | test-colors.sh | 12 | ||||
-rwxr-xr-x | test-commits.sh | 18 | ||||
-rwxr-xr-x | test-format-config.sh | 14 |
3 files changed, 22 insertions, 22 deletions
diff --git a/test-colors.sh b/test-colors.sh index 73c20f7..e28fb68 100755 --- a/test-colors.sh +++ b/test-colors.sh @@ -291,14 +291,14 @@ test_bash_colors_local() { git add . git commit -m "test commit" --quiet - printf -v expected " 1\x01local-ahead\x02↑\x01local-reset\x02" + printf -v expected "1\x01local-ahead\x02↑\x01local-reset\x02" assertEquals "$expected" "$(bash_color_local_commits)" assertEquals "$expected" "$(color_local_commits)" git push --quiet >/dev/null git reset --hard head^ --quiet >/dev/null - printf -v expected " 1\x01local-behind\x02↓\x01local-reset\x02" + printf -v expected "1\x01local-behind\x02↓\x01local-reset\x02" assertEquals "$expected" "$(bash_color_local_commits)" assertEquals "$expected" "$(color_local_commits)" @@ -306,7 +306,7 @@ test_bash_colors_local() { git add . git commit -m "new commit" --quiet - printf -v expected " 1\x01local-diverged\x02⇵\x01local-reset\x021" + printf -v expected "1\x01local-diverged\x02⇵\x01local-reset\x021" assertEquals "$expected" "$(bash_color_local_commits)" assertEquals "$expected" "$(color_local_commits)" @@ -337,18 +337,18 @@ test_zsh_colors_local() { git add . git commit -m "test commit" --quiet - assertEquals " 1%{local-ahead%}↑%{local-reset%}" "$(zsh_color_local_commits)" + assertEquals "1%{local-ahead%}↑%{local-reset%}" "$(zsh_color_local_commits)" git push --quiet >/dev/null git reset --hard head^ --quiet >/dev/null - assertEquals " 1%{local-behind%}↓%{local-reset%}" "$(zsh_color_local_commits)" + assertEquals "1%{local-behind%}↓%{local-reset%}" "$(zsh_color_local_commits)" echo "foo" > foo git add . git commit -m "new commit" --quiet - assertEquals " 1%{local-diverged%}⇵%{local-reset%}1" "$(zsh_color_local_commits)" + assertEquals "1%{local-diverged%}⇵%{local-reset%}1" "$(zsh_color_local_commits)" rm_tmp } diff --git a/test-commits.sh b/test-commits.sh index 1a4a86c..6c317f9 100755 --- a/test-commits.sh +++ b/test-commits.sh @@ -402,9 +402,9 @@ test_local_commits() { git add . git commit -m "test commit" --quiet - assertEquals " 1$up" "$(zsh_color_local_commits)" - assertEquals " 1$up" "$(bash_color_local_commits)" - assertEquals " 1$up" "$(color_local_commits)" + assertEquals "1$up" "$(zsh_color_local_commits)" + assertEquals "1$up" "$(bash_color_local_commits)" + assertEquals "1$up" "$(color_local_commits)" cd "$remote" echo "foo" > foo @@ -414,15 +414,15 @@ test_local_commits() { cd "$repo" git fetch origin --quiet - assertEquals " 1${both}1" "$(zsh_color_local_commits)" - assertEquals " 1${both}1" "$(bash_color_local_commits)" - assertEquals " 1${both}1" "$(color_local_commits)" + assertEquals "1${both}1" "$(zsh_color_local_commits)" + assertEquals "1${both}1" "$(bash_color_local_commits)" + assertEquals "1${both}1" "$(color_local_commits)" git reset --hard HEAD^ --quiet - assertEquals " 1$down" "$(zsh_color_local_commits)" - assertEquals " 1$down" "$(bash_color_local_commits)" - assertEquals " 1$down" "$(color_local_commits)" + assertEquals "1$down" "$(zsh_color_local_commits)" + assertEquals "1$down" "$(bash_color_local_commits)" + assertEquals "1$down" "$(color_local_commits)" } . ./shunit/shunit2 diff --git a/test-format-config.sh b/test-format-config.sh index 8b786c9..036a87b 100755 --- a/test-format-config.sh +++ b/test-format-config.sh @@ -75,7 +75,7 @@ test_all_options_set_config() { unset_colours prompt="$(render_prompt)" - assertEquals "$prompt" "m 1 → foo 1↑ 1A" + assertEquals "$prompt" "m 1 → foo1↑ 1A" export GIT_RADAR_FORMAT="%{remote}%{branch}%{changes}" prepare_zsh_colors @@ -89,7 +89,7 @@ test_all_options_set_config() { unset_colours prompt="$(render_prompt)" - assertEquals "$prompt" "foo 1↑ 1A" + assertEquals "$prompt" "foo1↑ 1A" export GIT_RADAR_FORMAT="%{branch}%{changes}" prepare_zsh_colors @@ -116,21 +116,21 @@ test_reorder_parts() { unset_colours prompt="$(render_prompt)" - assertEquals "foo 1↑ 1Am 1 → " "$prompt" + assertEquals "foo1↑ 1Am 1 → " "$prompt" export GIT_RADAR_FORMAT="%{local}%{changes}%{remote}%{branch}" prepare_zsh_colors unset_colours prompt="$(render_prompt)" - assertEquals " 1↑ 1Am 1 → foo" "$prompt" + assertEquals "1↑ 1Am 1 → foo" "$prompt" export GIT_RADAR_FORMAT="%{changes}%{remote}%{branch}%{local}" prepare_zsh_colors unset_colours prompt="$(render_prompt)" - assertEquals " 1Am 1 → foo 1↑" "$prompt" + assertEquals " 1Am 1 → foo1↑" "$prompt" rm_tmp } @@ -163,14 +163,14 @@ test_prefix_and_suffix_local() { unset_colours prompt="$(render_prompt)" - assertEquals " 1↑" "$prompt" + assertEquals "1↑" "$prompt" export GIT_RADAR_FORMAT="%{[:local:]}" prepare_zsh_colors unset_colours prompt="$(render_prompt)" - assertEquals "[ 1↑]" "$prompt" + assertEquals "[1↑]" "$prompt" rm_tmp } |