Re: [PATCH v2 2/4] t3000: move non-submodule repo test to separate file

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

 



Kyle Meyer <kyle@xxxxxxxxxx> writes:

> a2d5156c2b (resolve_gitlink_ref: ignore non-repository paths,
> 2016-01-22) added a test to t3000-ls-files-others.sh to check that
> 'ls-files -o' does not die() when given a subdirectory that looks like
> a repository but is actually a subdirectory containing a bogus .git
> file.
>
> Move this test to a separate file in preparation for testing scenarios
> with non-submodule repositories that are not bogus.

It is unclear to me why this is needed.

> +++ b/t/t3009-ls-files-others-nonsubmodule.sh
> @@ -0,0 +1,21 @@
> +#!/bin/sh
> +
> +test_description='test git ls-files --others with non-submodule repositories'
> +
> +. ./test-lib.sh
> +
> +test_expect_success 'setup: expected output' '
> +	cat >expected <<-EOF
> +	expected
> +	output
> +	EOF
> +'

I think this is overkill.  Usually we have one expectation for a
single test, so having the above inside the actual test below makes
more sense.

Or are you planning to add more tests before the test_done we see
below, all of which expect the above output?  It would make perfect
sense if it were the case, but I do not think that is what is
happenning here...

> +test_expect_success 'ls-files --others handles non-submodule .git' '
> +	mkdir not-a-submodule &&
> +	echo foo >not-a-submodule/.git &&
> +	git ls-files -o >output &&
> +	test_cmp expected output
> +'
> +
> +test_done



[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]

  Powered by Linux