Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
tests: move convenience regexp to match object names to test-lib.sh
author
Junio C Hamano
<gitster@pobox.com>
Sun, 20 Sep 2009 18:10:14 +0000
(11:10 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 4 Jan 2010 05:17:16 +0000
(21:17 -0800)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/diff-lib.sh
patch
|
blob
|
history
t/t1000-read-tree-m-3way.sh
patch
|
blob
|
history
t/t1001-read-tree-m-2way.sh
patch
|
blob
|
history
t/t1002-read-tree-m-u-2way.sh
patch
|
blob
|
history
t/t3100-ls-tree-restrict.sh
patch
|
blob
|
history
t/t3101-ls-tree-dirname.sh
patch
|
blob
|
history
t/t4006-diff-mode.sh
patch
|
blob
|
history
t/t6012-rev-list-simplify.sh
patch
|
blob
|
history
t/test-lib.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
902f235
)
diff --git
a/t/diff-lib.sh
b/t/diff-lib.sh
index 4bddeb591ecc17ec532164d0d6cf1ad1a54eb996..75a35fcd0699940aea51534b5fe954847bed7bb9 100644
(file)
--- a/
t/diff-lib.sh
+++ b/
t/diff-lib.sh
@@
-1,7
+1,5
@@
:
:
-_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
-_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
sanitize_diff_raw='/^:/s/ '"$_x40"' '"$_x40"' \([A-Z]\)[0-9]* / X X \1# /'
compare_diff_raw () {
# When heuristics are improved, the score numbers would change.
sanitize_diff_raw='/^:/s/ '"$_x40"' '"$_x40"' \([A-Z]\)[0-9]* / X X \1# /'
compare_diff_raw () {
# When heuristics are improved, the score numbers would change.
diff --git
a/t/t1000-read-tree-m-3way.sh
b/t/t1000-read-tree-m-3way.sh
index 22ba7a5442c587f4536aad5668df43661231de56..4f171722d9e1dda7668f54b4104267eb70d91c67 100755
(executable)
--- a/
t/t1000-read-tree-m-3way.sh
+++ b/
t/t1000-read-tree-m-3way.sh
@@
-126,9
+126,6
@@
cat >expected <<\EOF
100644 X 0 Z/NN
EOF
100644 X 0 Z/NN
EOF
-_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
-_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
-
check_result () {
git ls-files --stage | sed -e 's/ '"$_x40"' / X /' >current &&
test_cmp expected current
check_result () {
git ls-files --stage | sed -e 's/ '"$_x40"' / X /' >current &&
test_cmp expected current
diff --git
a/t/t1001-read-tree-m-2way.sh
b/t/t1001-read-tree-m-2way.sh
index c2d408b46120ef9d962272b652a68a83ba0852a5..6327d205cb89b00e77502031e3b56b4b895cc32d 100755
(executable)
--- a/
t/t1001-read-tree-m-2way.sh
+++ b/
t/t1001-read-tree-m-2way.sh
@@
-26,8
+26,6
@@
read_tree_twoway () {
git read-tree -m "$1" "$2" && git ls-files --stage
}
git read-tree -m "$1" "$2" && git ls-files --stage
}
-_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
-_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
compare_change () {
sed -n >current \
-e '/^--- /d; /^+++ /d; /^@@ /d;' \
compare_change () {
sed -n >current \
-e '/^--- /d; /^+++ /d; /^@@ /d;' \
diff --git
a/t/t1002-read-tree-m-u-2way.sh
b/t/t1002-read-tree-m-u-2way.sh
index 5e40cec530df07a8b7c088d31b28ac2d39abdc1b..0241329a08af0be642131ffe4b619231d9ea3844 100755
(executable)
--- a/
t/t1002-read-tree-m-u-2way.sh
+++ b/
t/t1002-read-tree-m-u-2way.sh
@@
-10,8
+10,6
@@
This is identical to t1001, but uses -u to update the work tree as well.
'
. ./test-lib.sh
'
. ./test-lib.sh
-_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
-_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
compare_change () {
sed >current \
-e '1{/^diff --git /d;}' \
compare_change () {
sed >current \
-e '1{/^diff --git /d;}' \
diff --git
a/t/t3100-ls-tree-restrict.sh
b/t/t3100-ls-tree-restrict.sh
index ee60d03fe8a582100e9df5511f6fea8900bcc543..eee0d344d24623ad9928366729c8efaea699fcd7 100755
(executable)
--- a/
t/t3100-ls-tree-restrict.sh
+++ b/
t/t3100-ls-tree-restrict.sh
@@
-43,8
+43,6
@@
test_expect_success \
tree=`git write-tree` &&
echo $tree'
tree=`git write-tree` &&
echo $tree'
-_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
-_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
test_output () {
sed -e "s/ $_x40 / X /" <current >check
test_cmp expected check
test_output () {
sed -e "s/ $_x40 / X /" <current >check
test_cmp expected check
diff --git
a/t/t3101-ls-tree-dirname.sh
b/t/t3101-ls-tree-dirname.sh
index 8be9fb411276e3c416374a813d691ff0455a8746..06654c6f82fb6cfe955b91bcbd4a5fa064c73e70 100755
(executable)
--- a/
t/t3101-ls-tree-dirname.sh
+++ b/
t/t3101-ls-tree-dirname.sh
@@
-39,8
+39,6
@@
test_expect_success \
tree=`git write-tree` &&
echo $tree'
tree=`git write-tree` &&
echo $tree'
-_x05='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
-_x40="$_x05$_x05$_x05$_x05$_x05$_x05$_x05$_x05"
test_output () {
sed -e "s/ $_x40 / X /" <current >check
test_cmp expected check
test_output () {
sed -e "s/ $_x40 / X /" <current >check
test_cmp expected check
diff --git
a/t/t4006-diff-mode.sh
b/t/t4006-diff-mode.sh
index 8c1b81e248bced2ccb5e4ff0067996462e89deb8..ff8c2f7532aa6fd748dbbdc0322384576f3a35ed 100755
(executable)
--- a/
t/t4006-diff-mode.sh
+++ b/
t/t4006-diff-mode.sh
@@
-20,8
+20,6
@@
test_expect_success \
'test_chmod +x rezrov &&
git diff-index $tree >current'
'test_chmod +x rezrov &&
git diff-index $tree >current'
-_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
-_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
sed -e 's/\(:100644 100755\) \('"$_x40"'\) \2 /\1 X X /' <current >check
echo ":100644 100755 X X M rezrov" >expected
sed -e 's/\(:100644 100755\) \('"$_x40"'\) \2 /\1 X X /' <current >check
echo ":100644 100755 X X M rezrov" >expected
diff --git
a/t/t6012-rev-list-simplify.sh
b/t/t6012-rev-list-simplify.sh
index 510bb9679f29c10645c902caea020651a797aa2f..af34a1e81711ca183680c9882353bd786b55e79f 100755
(executable)
--- a/
t/t6012-rev-list-simplify.sh
+++ b/
t/t6012-rev-list-simplify.sh
@@
-8,9
+8,6
@@
note () {
git tag "$1"
}
git tag "$1"
}
-_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
-_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
-
unnote () {
git name-rev --tags --stdin | sed -e "s|$_x40 (tags/\([^)]*\)) |\1 |g"
}
unnote () {
git name-rev --tags --stdin | sed -e "s|$_x40 (tags/\([^)]*\)) |\1 |g"
}
diff --git
a/t/test-lib.sh
b/t/test-lib.sh
index ec3336aba5a65a468bc6ce71f33a9cca76dbfe0f..05efe1faa337d94fc775b06ce7af432d5cea793a 100644
(file)
--- a/
t/test-lib.sh
+++ b/
t/test-lib.sh
@@
-74,6
+74,12
@@
case $(echo $GIT_TRACE |tr "[A-Z]" "[a-z]") in
;;
esac
;;
esac
+# Convenience
+#
+# A regexp to match 5 and 40 hexdigits
+_x05='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
+_x40="$_x05$_x05$_x05$_x05$_x05$_x05$_x05$_x05"
+
# Each test should start with something like this, after copyright notices:
#
# test_description='Description of this test...
# Each test should start with something like this, after copyright notices:
#
# test_description='Description of this test...