summaryrefslogtreecommitdiff
path: root/t/t3902-quoted.sh
AgeCommit message (Collapse)Author
2016-01-28mingw: do not bother to test funny file namesJohannes Schindelin
MSYS2 actually allows to create files or directories whose names contain tabs, newlines or colors, even if plain Win32 API cannot access them. As we are using an MSYS2 bash to run the tests, such files or directories are created successfully, but Git itself has no chance to work with them because it is a regular Windows program, hence limited by the Win32 API. With this change, on Windows otherwise failing tests in t3300-funny-names.sh, t3600-rm.sh, t3703-add-magic-pathspec.sh, t3902-quoted.sh, t4016-diff-quote.sh, t4135-apply-weird-filenames.sh, t9200-git-cvsexportcommit.sh, and t9903-bash-prompt.sh are skipped. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-03t3902-*.sh: Skip all tests rather than each testRamsay Jones
Each test in this file is skipped if the TABS_IN_FILENAMES test prerequisite is set. Use the 'skip_all' facility at the head of the file to skip all of the tests instead. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-11test: consolidate definition of $LFJunio C Hamano
As we seem to need this variable that holds a single LF character in many places, define it in test-lib.sh and let the test scripts use it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-09tests: add missing &&Jonathan Nieder
Breaks in a test assertion's && chain can potentially hide failures from earlier commands in the chain. Commands intended to fail should be marked with !, test_must_fail, or test_might_fail. The examples in this patch do not require that. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18t/t3902-quoted: change from skip_all=* to prereq skipÆvar Arnfjörð Bjarmason
Change this test to skip test with test prerequisites, and to do setup work in tests. This improves the skipped statistics on platforms where the test isn't run. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-25tests: Skip tests in a way that makes sense under TAPÆvar Arnfjörð Bjarmason
SKIP messages are now part of the TAP plan. A TAP harness now knows why a particular test was skipped and can report that information. The non-TAP harness built into Git's test-lib did nothing special with these messages, and is unaffected by these changes. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-09t3902: Protect against OS X normalizationBrian Gernhardt
8424981: "Fix invalid read in quote_c_style_counted" introduced a test that used "caractère spécial" as a directory name. Git creates it as "caract\303\250re sp\303\251cial" OS X stores it as "caracte\314\200re spe\314\201cial" To work around this problem, use the already introduced $FN as the directory name. Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-06Fix invalid read in quote_c_style_countedJeff King
This function did not work on strings that were not NUL-terminated. It reads through a length-bounded string, searching for characters in need of quoting. After we find one, we output the quoted character, then advance our pointer to find the next one. However, we never decremented the length, meaning we ended up looking at whatever random junk was stored after the string. This bug was not found by the existing tests because most code paths feed a NUL-terminated string. The notable exception is a directory name being fed by ls-tree. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-26Suppress some bash redirection error messagesRamsay Jones
In particular, when testing if the filesystem allows tabs in filenames, bash issues an error something like: ./t4016-diff-quote.sh: pathname with HT: No such file or directory which is caused by the failure of the (stdout) redirection, since the file cannot be created. In order to suppress the error message, you must redirect stderr to /dev/null, *before* the stdout redirection on the command-line. Also, remove a redundant filesystem check from the begining of the t3902-quoted.sh test and standardise the "test skipped" message to 'say' on exit. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13add test_cmp function for test scriptsJeff King
Many scripts compare actual and expected output using "diff -u". This is nicer than "cmp" because the output shows how the two differ. However, not all versions of diff understand -u, leading to unnecessary test failure. This adds a test_cmp function to the test scripts and switches all "diff -u" invocations to use it. The function uses the contents of "$GIT_TEST_CMP" to compare its arguments; the default is "diff -u". On systems with a less-capable diff, you can do: GIT_TEST_CMP=cmp make test Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14Skip t3902-quoted.sh if the file system does not support funny names.Johannes Sixt
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-13t3902 - skip test if file system doesn't support HT in namesMark Levedahl
Windows / cygwin don't support HT, LF, or TAB in file name so this test is meaningless there. Signed-off-by: Mark Levedahl <mdl123@verizon.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-24Add core.quotepath configuration variable.Junio C Hamano
We always quote "unusual" byte values in a pathname using C-string style, to make it safer for parsing scripts that do not handle NUL separated records well (or just too lazy to bother). The absolute minimum bytes that need to be quoted for this purpose are TAB, LF (and other control characters), double quote and backslash. However, we have also always quoted the bytes in high 8-bit range; this was partly because we were lazy and partly because we were being cautious. This introduces an internal "quote_path_fully" variable, and core.quotepath configuration variable to control it. When set to false, it does not quote bytes in high 8-bit range anymore but passes them intact. The variable defaults to "true" to retain the traditional behaviour for now. Signed-off-by: Junio C Hamano <gitster@pobox.com>