<commit_before>#!/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_expect_success '80 columns' '
	cat >expected <<\EOF &&
one    two    three  four   five   six    seven  eight  nine   ten    eleven
EOF
	COLUMNS=80 git column --mode=column <lista >actual &&
	test_cmp expected actual
'

test_expect_success 'COLUMNS = 1' '
	cat >expected <<\EOF &&
one
two
three
four
five
six
seven
eight
nine
ten
eleven
EOF
	COLUMNS=1 git column --mode=column <lista >actual &&
	test_cmp expected actual
'

test_expect_success 'width = 1' '<commit_msg>t9002: work around shells that are unable to set COLUMNS to 1<commit_after>#!/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_expect_success '80 columns' '
	cat >expected <<\EOF &&
one    two    three  four   five   six    seven  eight  nine   ten    eleven
EOF
	COLUMNS=80 git column --mode=column <lista >actual &&
	test_cmp expected actual
'

cat >expected <<\EOF
one
two
three
four
five
six
seven
eight
nine
ten
eleven
EOF

test_expect_success COLUMNS_CAN_BE_1 'COLUMNS = 1' '
	COLUMNS=1 git column --mode=column <lista >actual &&
	test_cmp expected actual
'

test_expect_success 'width = 1' '
{'fraction_non_alphanumeric': 0.09653465346534654, 'fraction_numerical': 0.009900990099009901, 'mean_word_length': 3.9534313725490198, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4778470', 'n_tokens_mistral': 754, 'n_tokens_neox': 747, 'n_words': 242}