summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4ca0f18)
raw | patch | inline | side by side (parent: 4ca0f18)
author | Michael Haggerty <mhagger@alum.mit.edu> | |
Thu, 4 Aug 2011 04:36:31 +0000 (06:36 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 4 Aug 2011 22:53:20 +0000 (15:53 -0700) |
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t0003-attributes.sh | patch | blob | history |
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh
index 8892ba3bb2e55f16e4de3ee02c297077a6025740..a49f8a9813b81a1db41f22a2843e03abbc2aa61c 100755 (executable)
--- a/t/t0003-attributes.sh
+++ b/t/t0003-attributes.sh
) >a/b/.gitattributes &&
(
echo "global test=global"
- ) >"$HOME"/global-gitattributes
+ ) >"$HOME"/global-gitattributes &&
+ cat <<EOF >expect-all
+f: test: f
+a/f: test: f
+a/c/f: test: f
+a/g: test: a/g
+a/b/g: test: a/b/g
+b/g: test: unspecified
+a/b/h: test: a/b/h
+a/b/d/g: test: a/b/d/*
+onoff: test: unset
+offon: test: set
+no: notest: set
+no: test: unspecified
+a/b/d/no: notest: set
+a/b/d/no: test: a/b/d/*
+a/b/d/yes: notest: set
+a/b/d/yes: test: unspecified
+EOF
'
test_expect_success 'attribute test: read paths from stdin' '
- cat <<EOF > expect &&
-f: test: f
-a/f: test: f
-a/c/f: test: f
-a/g: test: a/g
-a/b/g: test: a/b/g
-b/g: test: unspecified
-a/b/h: test: a/b/h
-a/b/d/g: test: a/b/d/*
-onoff: test: unset
-offon: test: set
-no: test: unspecified
-a/b/d/no: test: a/b/d/*
-a/b/d/yes: test: unspecified
-EOF
-
+ grep -v notest < expect-all > expect &&
sed -e "s/:.*//" < expect | git check-attr --stdin test > actual &&
test_cmp expect actual
'
test_expect_success 'attribute test: --all option' '
- cat <<EOF > all &&
-f: test: f
-a/f: test: f
-a/c/f: test: f
-a/g: test: a/g
-a/b/g: test: a/b/g
-b/g: test: unspecified
-a/b/h: test: a/b/h
-a/b/d/g: test: a/b/d/*
-onoff: test: unset
-offon: test: set
-no: notest: set
-a/b/d/no: test: a/b/d/*
-a/b/d/no: notest: set
-a/b/d/yes: notest: set
-EOF
-
- grep -v unspecified < all | sort > expect &&
- sed -e "s/:.*//" < all | uniq | git check-attr --stdin --all | sort > actual &&
+ grep -v unspecified < expect-all | sort > expect &&
+ sed -e "s/:.*//" < expect-all | uniq |
+ git check-attr --stdin --all | sort > actual &&
test_cmp expect actual
'