summaryrefslogtreecommitdiff
path: root/t/t9002-column.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-04-21 04:44:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-04-27 16:26:37 (GMT)
commit7e29b8254f08af820b2f0c3770836638ffe517ab (patch)
treea30cbc7e6997728a87f15093b13da82738a9dc91 /t/t9002-column.sh
parentb082687cbac951d31bdea346404db5d0b99a0b73 (diff)
downloadgit-7e29b8254f08af820b2f0c3770836638ffe517ab.zip
git-7e29b8254f08af820b2f0c3770836638ffe517ab.tar.gz
git-7e29b8254f08af820b2f0c3770836638ffe517ab.tar.bz2
Add column layout skeleton and git-column
A column option string consists of many token separated by either a space or a comma. A token belongs to one of three groups: - enabling: always, never and auto - layout mode: currently plain (which does not layout at all) - other future tuning flags git-column can be used to pipe output to from a command that wants column layout, but not to mess with its own output code. Simpler output code can be changed to use column layout code directly. Thanks-to: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9002-column.sh')
-rwxr-xr-xt/t9002-column.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/t/t9002-column.sh b/t/t9002-column.sh
new file mode 100755
index 0000000..a7f3cd9
--- /dev/null
+++ b/t/t9002-column.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+test_description='git column'
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+ cat >lista <<\EOF
+one
+two
+three
+four
+five
+six
+seven
+eight
+nine
+ten
+eleven
+EOF
+'
+
+test_expect_success 'never' '
+ git column --indent=Z --mode=never <lista >actual &&
+ test_cmp lista actual
+'
+
+test_expect_success 'always' '
+ cat >expected <<\EOF &&
+Zone
+Ztwo
+Zthree
+Zfour
+Zfive
+Zsix
+Zseven
+Zeight
+Znine
+Zten
+Zeleven
+EOF
+ git column --indent=Z --mode=plain <lista >actual &&
+ test_cmp expected actual
+'
+
+test_done