Re: [PATCH V5 16/17] Add tests for line history browser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bo Yang <struggleyb.nku@xxxxxxxxx> writes:

> +test_description='Test git log -L with single line of history
> +
> +'
> +. ./test-lib.sh
> +. "$TEST_DIRECTORY"/diff-lib.sh
> +
> +echo >path0 'void func(){
> +	int a = 0;
> +	int b = 1;
> +	int c;
> +	c = a + b;
> +}
> +'

Please do not have a set-up code like this one outside of test.

You may want to also adjust the coding style of the sample code ;-)  The
brace at the beginning of a function body sits at the leftmost column.

> +echo >path1 'void output(){
> +	printf("hello world");
> +}
> +'
> +
> +test_expect_success \
> +    'add path0/path1 and commit.' \
> +    'git add path0 path1 &&
> +     git commit -m "Base commit"'

And these days we indent and quote like this:

	test_expect_success 'what this test does' '
        	the body of the
                test
                comes
                here
	'

which makes it easier to read and by not requiring excessive use of
backslashes.

Perhaps like this (or use 'sed -e "s/^	|//"' instead of cat and indent the
here text by one tabstop plus a vertical bar)?

test_expect_success 'add path0/path1 and commit' '
	cat >path0 <<\EOF &&
void func(void)
{
        int a = 0;
        int b = 1;
	int c;
        c = a + b;
}
EOF
	cat >path1 <<\EOF &&
void output(void)
{
        printf("Hello, World!");
}
EOF
	git add path0 path1 &&
        test_tick &&
        git commit -m "Base commit"
'
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]