From unknown Mon Aug 18 00:06:15 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#40722 <40722@debbugs.gnu.org> To: bug#40722 <40722@debbugs.gnu.org> Subject: Status: [PATCH 2/4] test *broken*: augmented tests of (ice-9 getopt-long) Reply-To: bug#40722 <40722@debbugs.gnu.org> Date: Mon, 18 Aug 2025 07:06:15 +0000 retitle 40722 [PATCH 2/4] test *broken*: augmented tests of (ice-9 getopt-l= ong) reassign 40722 guile submitter 40722 Dale Mellor severity 40722 normal tag 40722 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 19 15:01:13 2020 Received: (at submit) by debbugs.gnu.org; 19 Apr 2020 19:01:13 +0000 Received: from localhost ([127.0.0.1]:45970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jQFBp-0005xR-17 for submit@debbugs.gnu.org; Sun, 19 Apr 2020 15:01:13 -0400 Received: from lists.gnu.org ([209.51.188.17]:43171) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jQEVc-0004op-PT for submit@debbugs.gnu.org; Sun, 19 Apr 2020 14:17:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34074 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQEVc-0005rh-7h for bug-guile@gnu.org; Sun, 19 Apr 2020 14:17:36 -0400 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=5.0 tests=RDNS_DYNAMIC, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQEVb-0006bc-Q9 for bug-guile@gnu.org; Sun, 19 Apr 2020 14:17:36 -0400 Received: from ec2-52-19-174-175.eu-west-1.compute.amazonaws.com ([52.19.174.175]:45790 helo=rdmp.org) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jQEVb-0006Xd-9M for bug-guile@gnu.org; Sun, 19 Apr 2020 14:17:35 -0400 Received: from [127.0.0.1] (helo=localhost) by rdmp.org with esmtp (Exim 4.92) (envelope-from ) id 1jQE2b-0002Xd-Hm for bug-guile@gnu.org; Sun, 19 Apr 2020 17:47:37 +0000 Message-ID: <1ffc667b08c617c0082720db5b0105a64b79ce40.camel@rdmp.org> Subject: [PATCH 2/4] test *broken*: augmented tests of (ice-9 getopt-long) From: Dale Mellor To: bug-guile@gnu.org Date: Sun, 19 Apr 2020 18:47:37 +0100 Organization: DM Bespoke Computer Solutions Ltd Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: softfail client-ip=52.19.174.175; envelope-from=guile-qf1qmg@rdmp.org; helo=rdmp.org X-detected-operating-system: by eggs1p.gnu.org: Genre and OS details not recognized. X-Received-From: 52.19.174.175 X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 19 Apr 2020 15:01:09 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) >From 57da5a3ae02008c4c66da21055749e51342fdd7e Mon Sep 17 00:00:00 2001 From: Dale Mellor Date: Sun, 19 Apr 2020 18:00:33 +0100 Subject: [PATCH 2/4] test *broken*: augmented tests of (ice-9 getopt-long) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is to prepare the ground for some test-driven development mainly to make the module satisfy the needs of the GNU Mcron project. The main requirement is for the module to be more intelligent when dealing with optional values to command-line options: if the following argument looks like a new option then treat it as such, otherwise treat it as the value of the current option. The particular case is mcronʼs -s option which needs to assume a default value of “8” if there is not one on the command line, but currently ‘mcron -s input_file’ fails badly. Other tests introduced involve allowing negative numbers as option values, and dealing with various cases of option-processing termination. * test-suite/tests/getopt-long.test: new code added. --- test-suite/tests/getopt-long.test | 88 ++++++++++++++++++++++++++----- 1 file changed, 76 insertions(+), 12 deletions(-) diff --git a/test-suite/tests/getopt-long.test b/test-suite/tests/getopt-long.test index a837b0799..b0530fe62 100644 --- a/test-suite/tests/getopt-long.test +++ b/test-suite/tests/getopt-long.test @@ -78,8 +78,8 @@ (with-test-prefix "exported procs" - (pass-if "`option-ref' defined" (defined? 'option-ref)) - (pass-if "`getopt-long' defined" (defined? 'getopt-long))) + (pass-if "‘option-ref’ defined" (defined? 'option-ref)) + (pass-if "‘getopt-long’ defined" (defined? 'getopt-long))) (with-test-prefix "specifying predicate" @@ -150,6 +150,15 @@ (test "--bar --foo" '((()) (foo . #t) (bar . #t)))) + (pass-if "long option with equals and space" + (test "--foo= test" + '((() "test") (foo . #t)))) + + (pass-if "long option with equals and space, not allowed a value" + (A-TEST "--foo= test" + '((foo (value #f))) + '((() "test") (foo . #t)))) + (pass-if "--=" (test "--=" '((() "--=")))) @@ -167,16 +176,16 @@ (bar))) 'foo #f))) - (pass-if "option-ref `--foo 4'" + (pass-if "option-ref ‘--foo 4’" (test4 "4" "--foo" "4")) - (pass-if "option-ref `-f 4'" + (pass-if "option-ref ‘-f 4’" (test4 "4" "-f" "4")) - (pass-if "option-ref `-f4'" + (pass-if "option-ref ‘-f4’" (test4 "4" "-f4")) - (pass-if "option-ref `--foo=4'" + (pass-if "option-ref ‘--foo=4’" (test4 "4" "--foo=4")) ) @@ -262,8 +271,8 @@ (with-test-prefix "apples-blimps-catalexis example" (define spec '((apples (single-char #\a)) - (blimps (single-char #\b) (value #t)) - (catalexis (single-char #\c) (value #t)))) + (blimps (single-char #\b) (value #t)) + (catalexis (single-char #\c) (value #t)))) (define (test8 . args) (equal? (sort (getopt-long (cons "foo" args) spec) @@ -281,9 +290,38 @@ (pass-if "normal 2" (test8 "-ab" "bang" "-c" "couth")) (pass-if "normal 3" (test8 "-ac" "couth" "-b" "bang")) - (pass-if-fatal-exception "bad ordering causes missing option" - exception:option-must-have-arg - (test8 "-abc" "couth" "bang")) + + ;;;; Dale Mellor 2020-04-14 + ;;;; + ;;;; I disagree with this test: to my mind 'c' is 'b's argument, and + ;;;; the other two arguments are non-options which get passed + ;;;; through; there should not be an exception. + + ;; (pass-if-fatal-exception "bad ordering causes missing option" + ;; exception:option-must-have-arg + ;; (test8 "-abc" "couth" "bang")) + + (pass-if "clumped options with trailing mandatory value" + (A-TEST "-abc couth bang" + spec + '((() "couth" "bang") (apples . #t) (blimps . "c")))) + + (pass-if "clumped options with trailing optional value" + (A-TEST "-abc couth bang" + '((apples (single-char #\a)) + (blimps (single-char #\b) + (value optional))) + '((() "couth" "bang") (apples . #t) (blimps . "c")))) + + (pass-if "clumped options with trailing optional value" + (A-TEST "-abc couth bang" + '((apples (single-char #\a)) + (blimps (single-char #\b) + (value optional)) + (catalexis (single-char #\c) + (value #t))) + '((() "bang") + (apples . #t) (blimps . #t) (catalexis . "couth")))) ) @@ -326,12 +364,19 @@ (with-test-prefix "stop-at-first-non-option" (pass-if "guile-tools compile example" - (equal? (getopt-long '("guile-tools" "compile" "-Wformat" "eval.scm" "-o" "eval.go") + (equal? (getopt-long '("guile-tools" "compile" "-Wformat" + "eval.scm" "-o" "eval.go") '((help (single-char #\h)) (version (single-char #\v))) #:stop-at-first-non-option #t) '((() "compile" "-Wformat" "eval.scm" "-o" "eval.go")))) + (pass-if "stop after option" + (equal? (getopt-long '("foo" "-a" "3" "4" "-b" "4") + '((about (single-char #\a) (value #t)) + (breathe (single-char #\b) (value #t))) + #:stop-at-first-non-option #t) + '((() "4" "-b" "4") (about . "3")))) ) @@ -356,6 +401,11 @@ '((() "--ben" "dave" "--charles") (abby . #t)) #:stop-at-first-non-option #t)) + (pass-if "first non-option before marker" + (test "--abby dave --ben -- --charles" + '((() "dave" "--ben" "--" "--charles") (abby . #t)) + #:stop-at-first-non-option #t)) + (pass-if "double end marker" (test "--abby -- -- --ben" '((() "--" "--ben") (abby . #t)))) @@ -409,6 +459,14 @@ (pass-if "non-predicated -o-1" (test "-c-1" '((()) (charles . "-1")))) + (pass-if-fatal-exception "non-predicated --optional -1" + exception:no-such-option + (test "--charles -1" '((()) (charles . "-1")))) + + (pass-if-fatal-exception "non-predicated -o -1" + exception:no-such-option + (test "-c -1" '((()) (charles . "-1")))) + (pass-if "non-predicated --mandatory=-1" (test "--dave=-1" '((()) (dave . "-1")))) @@ -444,9 +502,15 @@ (pass-if "-s 8" (test "-s 8 file" '((() "file") (schedule . "8")))) + (pass-if "-s file" + (test "-s file" '((() "file") (schedule . #t)))) + (pass-if "-sd file" (test "-sd file" '((() "file") (daemon . #t) (schedule . #t)))) + (pass-if "-ds file" + (test "-ds file" '((() "file") (daemon . #t) (schedule . #t)))) + (pass-if "--schedule=8" (test "--schedule=8 file" '((() "file") (schedule . "8")))) -- 2.20.1 From debbugs-submit-bounces@debbugs.gnu.org Tue May 12 09:05:16 2020 Received: (at control) by debbugs.gnu.org; 12 May 2020 13:05:16 +0000 Received: from localhost ([127.0.0.1]:54561 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYUay-0007Qq-Ah for submit@debbugs.gnu.org; Tue, 12 May 2020 09:05:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYUaw-0007QM-7U for control@debbugs.gnu.org; Tue, 12 May 2020 09:05:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40224) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYUar-0007Vc-0j for control@debbugs.gnu.org; Tue, 12 May 2020 09:05:09 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=41868 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jYUao-0001gX-Pw for control@debbugs.gnu.org; Tue, 12 May 2020 09:05:07 -0400 Date: Tue, 12 May 2020 15:05:05 +0200 Message-Id: <87blmtb8xq.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #40719 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) merge 40719 40722 quit From debbugs-submit-bounces@debbugs.gnu.org Tue May 12 09:05:23 2020 Received: (at control) by debbugs.gnu.org; 12 May 2020 13:05:23 +0000 Received: from localhost ([127.0.0.1]:54564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYUb5-0007RC-HM for submit@debbugs.gnu.org; Tue, 12 May 2020 09:05:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYUb4-0007Qy-73 for control@debbugs.gnu.org; Tue, 12 May 2020 09:05:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40227) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYUay-0007Zn-WB for control@debbugs.gnu.org; Tue, 12 May 2020 09:05:17 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=41870 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jYUay-0001hx-AT for control@debbugs.gnu.org; Tue, 12 May 2020 09:05:16 -0400 Date: Tue, 12 May 2020 15:05:15 +0200 Message-Id: <87a72db8xg.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #40719 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) merge 40719 40723 quit From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 02 06:43:27 2020 Received: (at control) by debbugs.gnu.org; 2 Aug 2020 10:43:27 +0000 Received: from localhost ([127.0.0.1]:41779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k2BSh-0001Uz-1E for submit@debbugs.gnu.org; Sun, 02 Aug 2020 06:43:27 -0400 Received: from rdmp.org ([52.19.174.175]:36166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k2BSf-0001Un-QO for control@debbugs.gnu.org; Sun, 02 Aug 2020 06:43:26 -0400 Received: from [127.0.0.1] (helo=localhost) by rdmp.org with esmtp (Exim 4.92) (envelope-from ) id 1k2BSa-0005us-4z for control@debbugs.gnu.org; Sun, 02 Aug 2020 10:43:20 +0000 Message-ID: <0ca636036e23abf21b9725753051f9cf88ac5f30.camel@rdmp.org> Subject: From: Dale Mellor To: control Date: Sun, 02 Aug 2020 11:43:19 +0100 Organization: DM Bespoke Computer Solutions Ltd Content-Type: text/plain User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 4.9 (++++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: close 40719 Content analysis details: (4.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.9 SPF_HELO_SOFTFAIL SPF: HELO does not match SPF record (softfail) 2.0 BLANK_SUBJECT Subject is present but empty 0.0 TVD_SPACE_RATIO No description available. 1.0 PDS_TONAME_EQ_TOLOCAL_VSHORT Very short body and From looks like 2 different emails X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 3.9 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: close 40719 Content analysis details: (3.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.9 SPF_HELO_SOFTFAIL SPF: HELO does not match SPF record (softfail) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 2.0 BLANK_SUBJECT Subject is present but empty 0.0 TVD_SPACE_RATIO No description available. 1.0 PDS_TONAME_EQ_TOLOCAL_VSHORT Very short body and From looks like 2 different emails close 40719 From unknown Mon Aug 18 00:06:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 30 Aug 2020 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator