diff options
author | Thomas Rast <trast@student.ethz.ch> | 2010-12-18 17:17:54 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-01-18 08:51:58 -0800 |
commit | 8d96e7288f2be9de6d09352dc445f18f89564500 (patch) | |
tree | 664c85e92832fbb8f10b8af2c4efddea224b75af /t/t4034-diff-words.sh | |
parent | adf872e7837cc92e390f00ee32f32c5639d3a444 (diff) | |
download | git-8d96e7288f2be9de6d09352dc445f18f89564500.tar.gz |
t4034: bulk verify builtin word regex sanity
The builtin word regexes should be tested with some simple examples
against simple issues. Do this in bulk.
Mainly due to a lack of language knowledge and inspiration, most of
the test cases (cpp, csharp, java, objc, pascal, php, python, ruby)
are directly based off a C operator precedence table to verify that
all operators are split correctly. This means that they are probably
incomplete or inaccurate except for 'cpp' itself.
Still, they are good enough to already have uncovered a typo in the
python and ruby patterns.
'fortran' is based on my anecdotal knowledge of the DO10I parsing
rules, and thus probably useless. The rest (bibtex, html, tex) are an
ad-hoc test of what I consider important splits in those languages.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4034-diff-words.sh')
-rwxr-xr-x | t/t4034-diff-words.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh index 8096d8a337..2647191e7f 100755 --- a/t/t4034-diff-words.sh +++ b/t/t4034-diff-words.sh @@ -331,4 +331,19 @@ test_expect_success '--word-diff=none' ' ' +word_diff_for_language () { + cp "$TEST_DIRECTORY/t4034/$1/pre" \ + "$TEST_DIRECTORY/t4034/$1/post" \ + "$TEST_DIRECTORY/t4034/$1/expect" . && + echo "* diff=$1" >.gitattributes && + word_diff --color-words && cp output output.$1 +} + +for lang_dir in $TEST_DIRECTORY/t4034/*; do + lang=${lang_dir#$TEST_DIRECTORY/t4034/} + test_expect_success "diff driver '$lang' has sane word regex" " + word_diff_for_language $lang + " +done + test_done |