summaryrefslogtreecommitdiff
path: root/test-ctype.c
Commit message (Collapse)AuthorAgeFilesLines
* test helpers: move test-* to t/helper/ subdirectoryNguyễn Thái Ngọc Duy2016-04-151-42/+0
| | | | | | | | This keeps top dir a bit less crowded. And because these programs are for testing purposes, it makes sense that they stay somewhere in t/ Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* test-ctype: add test for is_pathspec_magicrs/test-ctypeRené Scharfe2011-10-031-0/+1
| | | | | Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* test-ctype: macrofyRené Scharfe2011-10-031-58/+21
| | | | | | | | | | | Rewrite test-ctype to use a global variable and a macro instead of wrapper functions for each character class and complicated structs with loops going through them. The resulting code may be uglier, but that's OK for a test program, and it's actually easier to read and extend. And much shorter. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add is_regex_special()René Scharfe2009-01-171-0/+6
| | | | | | | | Add is_regex_special(), a character class macro for chars that have a special meaning in regular expressions. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Change NUL char handling of isspecial()René Scharfe2009-01-171-0/+6
| | | | | | | | | | | | | | | | Replace isspecial() by the new macro is_glob_special(), which is more, well, specialized. The former included the NUL char in its character class, while the letter only included characters that are special to file name globbing. The new name contains underscores because they enhance readability considerably now that it's made up of three words. Renaming the function is necessary to document its changed scope. The call sites of isspecial() are updated to check explicitly for NUL. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add ctype testRené Scharfe2009-01-171-0/+66
Manipulating the character class table in ctype.c by hand is error prone. To ensure that typos are found quickly, add a test program and script. test-ctype checks the output of the character class macros isspace() et. al. by applying them on all possible char values and consulting a list of all characters in the particular class. It doesn't check tolower() and toupper(); this could be added later. The test script t0070-fundamental.sh is created because there is no good place for the ctype test, yet -- except for t0000-basic.sh perhaps, but it doesn't run well on Windows, yet. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>