From patchwork Sat Feb 11 13:12:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ren=C3=A9_Scharfe?= X-Patchwork-Id: 13137072 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6ADD8C61DA4 for ; Sat, 11 Feb 2023 13:13:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229668AbjBKNNB (ORCPT ); Sat, 11 Feb 2023 08:13:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjBKNNA (ORCPT ); Sat, 11 Feb 2023 08:13:00 -0500 Received: from mout.web.de (mout.web.de [212.227.15.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2D3411EB5 for ; Sat, 11 Feb 2023 05:12:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1676121170; bh=zMin3KHULZT7qzyTMP6HegCQeHJ4kzRGt88VkudGSTk=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References:In-Reply-To; b=GTkYnGN6mk23AztndVnI3sghVF3449s5TDbdm0PDqlxOMp5H2ZkbTwsVsfeu6VPF8 wA8F0zVQkY1up4I8N9OsUQgdJLZ1QPtmXZKKIF4HhATNQ5VBytw8I8hAdC/ioeiFqG 4++w8KPoo0V0Ok3FxFbsQA53sIVlnXmcRbV/kU6I1cKxiN6gcL9CNu4Mu+ugxHvU/p 0NNhsvTLEDk0zP20PiasBO0S9YtP+Ji4ISD0PAXSAQO7HN6GAeLLlz+tFGe8lpnj18 aE+VrvBoUJDcsw6boLg9kqhKyXzFm5C3SNS0620YyhHvj0qRqEYp3jtv+mQZ78GcSg oIRMlddpvb8JA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.29] ([79.203.21.51]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N79NA-1oWgnd3bZ6-017VWy; Sat, 11 Feb 2023 14:12:49 +0100 Message-ID: <21f316ab-714a-58f6-a8d2-466d738b4ed3@web.de> Date: Sat, 11 Feb 2023 14:12:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: [PATCH 1/3] test-ctype: test isascii Content-Language: en-US From: =?utf-8?q?Ren=C3=A9_Scharfe?= To: Git List Cc: Junio C Hamano , Masahiro Yamada References: <06da58d6-6aae-7b1d-6ce6-f07d27f05d97@web.de> In-Reply-To: <06da58d6-6aae-7b1d-6ce6-f07d27f05d97@web.de> X-Provags-ID: V03:K1:sT6QzRqbavy71ZKDDKlQZ/S4IZ+doXV4bmtr30dhB9nTl7mEIWx qGNmxdzLDk7igDFk0amrWwMEUwUJU3+iRjApGYD/1xFyEQdZ1dNHBMEzNmayjP7m4utQRlF tMw/N6Mi9e65BYAvFkYyCMlsATi/9Oio7z9kV09hQXKP0TPBsUB46km6Vty8ox+1BFHtAgU 2TUua/qpqY2PMAH27sxHg== UI-OutboundReport: notjunk:1;M01:P0:buVFTKYC8vs=;ZdouMYILITPmm+Vx8uvbtI044ID HWSChjgoIKpncao8LFkLZQa6WrvDt/S97W7y11ILDiYzxvDPb2uxD4BAr9O/vPfD6b5NDXbhN 0USDYFr87qcgiUGAavvBhd7BfIJ8SRBzKYbFVuadDKe+/yDEDuhep8/6sqgU7IHChnAfiaHd2 K9RoZdoG1fu5m1TWlofau39zqoFsBCe+GzMHb9OrJnAaRgztbkpc2Y+7thTPyekqC7j8VaqUo fAFs/phK7CWNbp8v+Y/aiNUrqz6jZK/M84mBVIlKPZ6H4Epa2UPS/kkxRgBipQV78YidYMSrI BuDrQbQkAVzLbu/V/n8NV6mW0uUSPdk22pxZ55BHIEsJlezs68/pzoGcG16WhhwtVjLXIBV2s RvyriIOwBpt8FUpVN0/beIf/ccqhwHjS0BDWLvA+bfsS4NSen5/jcoh+U0Sw+Q45+6nFGjheC TkSFNfDZ/uzlQXnOxFO5YGW0P1U0KCqMKmZhzP/3an/JnbQ43P/UM9uTizCSbyYMls2MaJKPZ CaibW+fcpQEodHKecqSVDx0ktnNQMUcH7rLc3MuF/h89K0IMCmxM+vcjpOFMMBRZo3Zy6mXr4 V+2CKcZIXe6d0yVIIpmBryDyIG8V3CENsSzuf/OVp2ObuHIqQcCpyx8RfZ45/KTo0HOSn4N3y tUyt3/If4wxhNAPWD/zifHJInAtZtfX3pKbNkBQjagQyDcC6PiQA9ZoL1sSHg/5r4q3A27n9K hoJbkolnYOokXdCcBQEnNmdbAUewS4tL2RhN3H7DSGaQYxArKvqjH1gWMWYZqk4vDl/ufMXDY qYWcnxxm45Xpn0ij5OCfm57Vsl3ESgER4zq1WTU68mlkwfl9iabszP+2UdYAjDScxh8lbgwk3 bbHynrCjvjVYIyRd9JVP1U6FH0dY6KKIoGz1es6t9tVrArN8o3oEL3ZOrqvCA/iyJtco38LcV dgwXj8iqTzSLjpHLowBTBxNgbGA= Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Test the character classifier added by c2e9364a06 (cleanup: add isascii(), 2009-03-07). It returns 1 for NUL as well, which requires special treatment, as our string-based tester can't find it with strcmp(3). Allow NUL to be given as the first character in a class specification string. This has the downside of no longer supporting the empty string, but that's OK since we are not interested in testing character classes with no members. Signed-off-by: René Scharfe --- t/helper/test-ctype.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) -- 2.39.1 diff --git a/t/helper/test-ctype.c b/t/helper/test-ctype.c index 92c4c2313e..caf586649f 100644 --- a/t/helper/test-ctype.c +++ b/t/helper/test-ctype.c @@ -11,9 +11,14 @@ static void report_error(const char *class, int ch) static int is_in(const char *s, int ch) { - /* We can't find NUL using strchr. It's classless anyway. */ + /* + * We can't find NUL using strchr. Accept it as the first + * character in the spec -- there are no empty classes. + */ if (ch == '\0') - return 0; + return ch == *s; + if (*s == '\0') + s++; return !!strchr(s, ch); } @@ -28,6 +33,15 @@ static int is_in(const char *s, int ch) #define DIGIT "0123456789" #define LOWER "abcdefghijklmnopqrstuvwxyz" #define UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +#define ASCII \ + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" \ + "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" \ + "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f" \ + "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f" \ + "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f" \ + "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f" \ + "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f" \ + "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f" int cmd__ctype(int argc, const char **argv) { @@ -38,6 +52,7 @@ int cmd__ctype(int argc, const char **argv) TEST_CLASS(is_glob_special, "*?[\\"); TEST_CLASS(is_regex_special, "$()*+.?[\\^{|"); TEST_CLASS(is_pathspec_magic, "!\"#%&',-/:;<=>@_`~"); + TEST_CLASS(isascii, ASCII); return rc; } From patchwork Sat Feb 11 13:12:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ren=C3=A9_Scharfe?= X-Patchwork-Id: 13137073 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 009B3C61DA4 for ; Sat, 11 Feb 2023 13:13:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229750AbjBKNNF (ORCPT ); Sat, 11 Feb 2023 08:13:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjBKNNC (ORCPT ); Sat, 11 Feb 2023 08:13:02 -0500 Received: from mout.web.de (mout.web.de [212.227.15.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 590AC11EB5 for ; Sat, 11 Feb 2023 05:13:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1676121173; bh=Xf3NLivsPKxkA9WSNkn8ELP5dt02eEU0ID+bFAFOdSM=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References:In-Reply-To; b=hTHTjng3dIg5F4D0qcO7ht4nV7Lx11kq25M3EY3mURgXqmV1JY6Qna/vV7dJ/RWMu ahAkWnAXSZdfzgRkGSaCJHbIFOVJSInQGcIb/t5eqxn+tZ5iOfNeBfMUqZHgb7jW7Z MxUqgMLqBFfpTkI/TjRzLJIyIoVyhXNsxFrIz0kPrSx63dYPqxWvdvS1kv33NNPnF+ aAHJjEO+K2U8k9qwxV+7sikSXHrrfrJJmV1eiUIMj0sXZEHxIUwZw1Xn0CNJ/RMnRV G2f+tGwJMdInMxPdErxxTrXpoLIbcHlYosTgEGLlIMTGD2CaAddXgY9wwKkuykx1gN +YwopP+imRMkw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.29] ([79.203.21.51]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N1d7s-1oTPY51hY8-0122dv; Sat, 11 Feb 2023 14:12:53 +0100 Message-ID: Date: Sat, 11 Feb 2023 14:12:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: [PATCH 2/3] test-ctype: test islower and isupper Content-Language: en-US From: =?utf-8?q?Ren=C3=A9_Scharfe?= To: Git List Cc: Junio C Hamano , Masahiro Yamada References: <06da58d6-6aae-7b1d-6ce6-f07d27f05d97@web.de> In-Reply-To: <06da58d6-6aae-7b1d-6ce6-f07d27f05d97@web.de> X-Provags-ID: V03:K1:agT8FcZDR50/fxhhgudzrv9evcWRKXO1eNz+mCZnKGh4OmBMDH9 EFESdibAeW9ePtn3sKAPodSzlhHOGFTZ22fevlpe9kEzZ0mEHjsj9e0XIjnkRlifbTt2J3p oosidS/BG3dOJt8fhIklINGxxLwXHjdJSbEh2zyq8GE5azvpMLUkyY56lxMRXtYv42YaPSm LjkGCa+cm7GA1tYwCZV0A== UI-OutboundReport: notjunk:1;M01:P0:L4x+AO9nBqU=;D7Ca+Y1EQlH1UWcX/rXx08eFPmM SehbfDYzzfCOZ0ddlWbYq4/KSgpbzzxJv5xKBH3QU+Vz1FeQWf86rhRq8kfK5J8ER6LUkgL5F eQyhhOEDr1wYwvG1E8Re4b7bnfsqIJw20imz5p/iLsTp06XMfkoGiz42znhTa4u7/EGDlxFXM bPeyLCsRmhVWpSGLF9zSVNb5dnwIZpMOfdF3Wxc2fqZ78sW50m1NVr10gnFlwi83revAQFI7P 7C9iprDq2d9TnR2louIaABXs38BTwYx1ZmHrFthoi2qqFZiP/9cjRrK8K7vMCM1ORepIY3ydn EZF2s8+gaB9gECyu68/qfWBDAoBNw9ZeJ3vCi4cauUPTtxcTiavsFFP5tk/cf3tOdqtEejGgC atQ2yXeuxbBLaCbbl/HsvqIZfGVX3zNoKucJALnkRuZ2tnpDiUOAmh3BzEOdejzacwSfzrUqU hUWulwKRDOD90QLwF6I9oN61/JGt/GLcqusfScySvbOjVF30rA3OaJ5ypUqhmR4KODCH0HRd0 BweEV8yyRoFirh8StlKKhKcvAVgx82MYpb+C2RWHGfhR6Zk70W2lgM82c/NvuovKsTOCaC95u XApQgOQW8lmQRjSOlCHtlYsYFLYEpvNaIT1702yF6brcrEQCty4K0pOJDess20UA2kW4jMrry cmImhUUEcd9syypEeUyliT5gUBUaehWnTJN/fl4xJ7hvCyXpf2n76EdM2CFLOEOzUSLkUNACe 1gnbQZW3L2MQOk14X2JL9LaTLQPZLg31FxBflQ1xGZEiceaCOrWcJGVm2VLaF/FLZiCNNLNdZ LJXEbSg4TbOygZxsnFRsM6LXsjrREaRAn4DZGlki31Nz7cP+a8b7NALpowCoDGAES9UHL6fZC kqb9G8kXtT1M5++Kv2P74HAKcOCV7VOgXNgTJIUedlwc/x6GXAfEAQQEoZ8YmIz85fJeiWjc4 laufZQ== Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Test the character classifiers added by 43ccdf56ec (ctype: implement islower/isupper macro, 2012-02-10). Signed-off-by: René Scharfe --- t/helper/test-ctype.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.39.1 diff --git a/t/helper/test-ctype.c b/t/helper/test-ctype.c index caf586649f..8ac76e93e4 100644 --- a/t/helper/test-ctype.c +++ b/t/helper/test-ctype.c @@ -53,6 +53,8 @@ int cmd__ctype(int argc, const char **argv) TEST_CLASS(is_regex_special, "$()*+.?[\\^{|"); TEST_CLASS(is_pathspec_magic, "!\"#%&',-/:;<=>@_`~"); TEST_CLASS(isascii, ASCII); + TEST_CLASS(islower, LOWER); + TEST_CLASS(isupper, UPPER); return rc; } From patchwork Sat Feb 11 13:12:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ren=C3=A9_Scharfe?= X-Patchwork-Id: 13137074 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99BCFC636D7 for ; Sat, 11 Feb 2023 13:13:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229473AbjBKNNG (ORCPT ); Sat, 11 Feb 2023 08:13:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229747AbjBKNNF (ORCPT ); Sat, 11 Feb 2023 08:13:05 -0500 Received: from mout.web.de (mout.web.de [212.227.15.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CFC72D15D for ; Sat, 11 Feb 2023 05:13:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1676121176; bh=U2D/1Nq2ut2FgKUGyNznId4fcWTH2k32WEPmj4pJYq4=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References:In-Reply-To; b=aMtTRivjqoZPlXCdLJxvjoTT/fue7AsNpTSJAbmzGz47f88gLh/SWiXt2ab+UnifU zlaVcw/u0p0ww7fDSX+ey2+sw/L0kpRn8WWkrzCA2zU93edYa4ba70EN+mW7uWkCkU TNYKLp1zwWXjI9AkKcxAKPjTlGPGQ3goLE/qoy/ChQMc3tzdVrt67IxUkUerQU8nh3 /EXIGwRoMvdtHkfQuSW5ycJipAghXKLu8CeF20nZoVG16lxGGsI6zWRt3pJ6+y5q1J 3bSEs7dqK558Hb8ZWJrYG/2qYxJ1doxWsjQdW5C5EvUXBbOFwzcCi8mIFBBFol7daE hkeJk2hC5BNxg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.29] ([79.203.21.51]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MKM5z-1p9aJb22Dn-00LnGG; Sat, 11 Feb 2023 14:12:56 +0100 Message-ID: Date: Sat, 11 Feb 2023 14:12:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: [PATCH 3/3] test-ctype: test iscntrl, ispunct, isxdigit and isprint Content-Language: en-US From: =?utf-8?q?Ren=C3=A9_Scharfe?= To: Git List Cc: Junio C Hamano , Masahiro Yamada References: <06da58d6-6aae-7b1d-6ce6-f07d27f05d97@web.de> In-Reply-To: <06da58d6-6aae-7b1d-6ce6-f07d27f05d97@web.de> X-Provags-ID: V03:K1:8cPRvO/NFjJBwT5Wuf+O51a+y8AjHbxGDg7WeJQuB6K3QQxgC/T Xo+PJ6P3KXiqPKuSH1rODuZFheqkWgiGzfLNf0957/Vf9KnZt+VQk7LYK2cydFaryegX8dM NguG4uwaTGdpeZJoW6jREU0Ngn50rNkEVGtjULcl8g5VW3h7US+dKwzxb8zo07u50XznwWQ /W1yqWHh8p1uhVCF/PI9w== UI-OutboundReport: notjunk:1;M01:P0:1uIbcwB4uYE=;sTnFutQKoZ7oYnI3RKqpO6RQHUv dHburOQrB86H6+qZtcip9OGAhWCLBlq9nYFJTMjCNc5hL+usdmzbUN7slF21MJdRmnY6d+YQB 5PEvt/KHKMkWNMpvcGbTuaePDFQyBOgp2icUvzuLLzkgi+KIbTT69D/AfQJA1AQjFsOUOt0jo 6JznZgi+Cu4m/usciAE/lrckR9cfi4XDLkqG5UvePpR/W73AY53FS6KerW1ARMMd2+8nlPxxk AlJDW4/MLlfHA9YZOxOjxM23slTqnEZ/p847celrJhLLK8EH3d8TBHLxllI7uehMPg3DJDV/j PWudz7wFsN/7ucLQ58OgMv/aN18wQnRQ8WfrM7ix1z+22BEWjpg5iDb5JVUt+SmCeiBKLrXrX uo4FFKXwBfRz5A36GKVuC9Tjc19IfM1v2d3Hm7F3ruVyw3i1qOB3sf6KzCmV6NGGlR81pWYcR 2eUD9L0v7L4HZ7W5IUT29WL/cWAWCJn2KYjxPGjwlDdDeJVbj3agvRqtiedyYdVhPsOKC8u+W 2lCDq8HuKOpxVlawjG5nFbAyVFSRG0FvShgyn7yALDOUyaPDLg4/xACFSU69sLOdGp9fucjfn SZmIt9qe/hSo0nJ4beamGpxes3lCPS1vx+3UJwEUOpkic+v04XMohUUd7ENKBlFzstIbn6Prw 8Fx7NMZOffHTUL/OYeIVO5ouqwLNX/7iTgaxfzYwGhAE+/aDxLJU+jAk/7m+paB+EN0z2V3SS wc1rUtShTPI9poDhk2ayKWvA1hCZLvDvoAM8zx2Ze+TA1st+DHLX22vmLmGko0pTgWEMHER/Q taG6hi+JHAQTifYLxogEJZfjQ/5ZQNsTGN50td6ZswSBvpRBuy/WIJ8iRqpHZeVCyxqoe5dn5 QAVCbm1FG6ZE3xhlRCjCBxFi/zCWiStq4oquW/1rBT6u8pc0nghhgiMfr/M9iIfsv0G1ntIJD 2soMKg== Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Test the character classifiers added by 1c149ab2dd (ctype: support iscntrl, ispunct, isxdigit and isprint, 2012-10-15) and 0fcec2ce54 (format-patch: make rfc2047 encoding more strict, 2012-10-18). Signed-off-by: René Scharfe --- t/helper/test-ctype.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) -- 2.39.1 diff --git a/t/helper/test-ctype.c b/t/helper/test-ctype.c index 8ac76e93e4..d04da0d465 100644 --- a/t/helper/test-ctype.c +++ b/t/helper/test-ctype.c @@ -42,6 +42,17 @@ static int is_in(const char *s, int ch) "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f" \ "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f" \ "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f" +#define CNTRL \ + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" \ + "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" \ + "\x7f" +#define PRINT \ + "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f" \ + "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f" \ + "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f" \ + "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f" \ + "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f" \ + "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e" int cmd__ctype(int argc, const char **argv) { @@ -55,6 +66,10 @@ int cmd__ctype(int argc, const char **argv) TEST_CLASS(isascii, ASCII); TEST_CLASS(islower, LOWER); TEST_CLASS(isupper, UPPER); + TEST_CLASS(iscntrl, CNTRL); + TEST_CLASS(ispunct, "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"); + TEST_CLASS(isxdigit, DIGIT "abcdefABCDEF"); + TEST_CLASS(isprint, PRINT); return rc; }