summaryrefslogtreecommitdiffstats
path: root/test-format-config.sh
diff options
context:
space:
mode:
authorMichael Allen <michael@michaelallen.io>2015-09-15 10:04:15 +0100
committerMichael Allen <michael@michaelallen.io>2015-09-16 15:37:05 +0100
commit5c68ecdd5d388a4a5604c0f377c4b917eb0dcfff (patch)
tree417543323650f283428ff2f926fc73a906127ee6 /test-format-config.sh
parent8c682d2abddd006398e9aed0a61212b4648b5a59 (diff)
downloadgit-sonar-5c68ecdd5d388a4a5604c0f377c4b917eb0dcfff.tar.gz
git-sonar-5c68ecdd5d388a4a5604c0f377c4b917eb0dcfff.zip
Make render replace rather than append, so we can reorder
Diffstat (limited to 'test-format-config.sh')
-rwxr-xr-xtest-format-config.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/test-format-config.sh b/test-format-config.sh
index 17c4bd6..e595703 100755
--- a/test-format-config.sh
+++ b/test-format-config.sh
@@ -108,4 +108,31 @@ test_all_options_set_config() {
rm_tmp
}
+test_reorder_parts() {
+ prepare_test_repo
+
+ export GIT_RADAR_FORMAT="%{branch}%{local}%{changes}%{remote}"
+ prepare_zsh_colors
+ unset_colours
+
+ prompt="$(render_prompt)"
+ assertEquals "foo 1↑ 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"
+
+ export GIT_RADAR_FORMAT="%{changes}%{remote}%{branch}%{local}"
+ prepare_zsh_colors
+ unset_colours
+
+ prompt="$(render_prompt)"
+ assertEquals " 1Am 1 → foo 1↑" "$prompt"
+
+ rm_tmp
+}
+
. ./shunit/shunit2