Re: [PATCH v3 1/3] tests: Prepare --textconv tests for correctly-failing conversion program
On Tue, Sep 28, 2010 at 04:20:31PM +0400, Kirill Smelkov wrote:
Show 19 quoted lines
> On Tue, Sep 28, 2010 at 04:07:22PM +0400, Kirill Smelkov wrote:
> > diff --git a/t/t4042-diff-textconv-caching.sh b/t/t4042-diff-textconv-caching.sh
> > index 68fee12..6aaa10b 100755
> > --- a/t/t4042-diff-textconv-caching.sh
> > +++ b/t/t4042-diff-textconv-caching.sh
> > @@ -5,8 +5,8 @@ test_description='test textconv caching'
> >
> > cat >helper <<'EOF'
> > #!/bin/sh
> > -grep -q '^bin: ' "$@" || { echo "E: $@ is not \"binary\" file" 1>&2; exit 1; }
> > -sed 's/^bin: /converted: /' "$@" >helper.out
> > +grep -q '^bin: ' "$1" || { echo "E: $1 is not \"binary\" file" 1>&2; exit 1; }
> > +sed 's/^bin: /converted: /' "$1" >helper.out
> > cat helper.out
> > EOF
> > chmod +x helper
>
> Please ignore this - changing so breaks textconv cache tests in this
> file.Ok, here is what also is needed here
---- 8< ----
NOTE: in t4042, I had to correct args hack, and just roll second
textconv helper for cache-invalidates-on-textconv-change test. ...
diff --git a/t/t4042-diff-textconv-caching.sh b/t/t4042-diff-textconv-caching.sh
index 6aaa10b..c362261 100755
--- a/t/t4042-diff-textconv-caching.sh
+++ b/t/t4042-diff-textconv-caching.sh
@@ -9,7 +9,12 @@ grep -q '^bin: ' "$1" || { echo "E: $1 is not \"binary\" file" 1>&2; exit 1; }
sed 's/^bin: /converted: /' "$1" >helper.out
cat helper.out
EOF
-chmod +x helper
+cat >helper2 <<'EOF'
+#!/bin/sh
+echo "converted: other"
+./helper "$1"
+EOF
+chmod +x helper helper2
test_expect_success 'setup' '
echo "bin: foo content 1" >foo.bin &&
@@ -77,8 +82,7 @@ index 255496b..ad450ff 100644
+converted: foo content 2
EOF
test_expect_success 'changing textconv invalidates cache' '
- echo "bin: other" >other &&
- git config diff.magic.textconv "./helper other" &&
+ git config diff.magic.textconv ./helper2 &&
git diff HEAD^ HEAD >actual &&
test_cmp expect actual
'