From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.36.13.80 with SMTP id 77mr124408itx.40.1519342180432; Thu, 22 Feb 2018 15:29:40 -0800 (PST) X-Received: by 10.157.41.184 with SMTP id n53mr3511otb.11.1519342180317; Thu, 22 Feb 2018 15:29:40 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!w142no503695ita.0!news-out.google.com!s63ni1419itb.0!nntp.google.com!w142no503693ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 22 Feb 2018 15:29:40 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=149.32.224.39; posting-account=Qh2kiQoAAADpCLlhT_KTYoGO8dU3n4I6 NNTP-Posting-Host: 149.32.224.39 References: <3c869714-ed23-42dd-b0de-4521733da615@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: alternative elsif branch not tested From: Anh Vo Injection-Date: Thu, 22 Feb 2018 23:29:40 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2169 X-Received-Body-CRC: 3811407909 Xref: reader02.eternal-september.org comp.lang.ada:50576 Date: 2018-02-22T15:29:40-08:00 List-Id: On Thursday, February 22, 2018 at 3:09:17 PM UTC-8, Mehdi Saada wrote: > This piece shall verify the program's arguments. I don't understand why w= hatever the first argument is, it doesn't raise EXC_COMMANDE as expected. > It should do it if ARGUMENT(1)(1) isn't 'n','c','N','C'. > =20 > if Argument_Count /=3D 2 then PUT_LINE ("Pas le bon nombre d'argume= nts."); raise Exc_Commande; > elsif Argument (1)'Length /=3D 1 and ARGUMENT(1)(1) not in 'n'| 'c'= | 'N' | 'C' then > PUT_LINE ("Premi=C3=A8re argument incorrect: veuillez mettre un (= seul) charact=C3=A8re entre n, c, N et C."); raise Exc_Commande; > elsif ADA.Strings.Fixed.Index (Argument (2), Alphanumeric_Set, Outs= ide) /=3D 0 then > PUT_LINE ("Deuxi=C3=A8me argument incorrect: l'acronyme ne peut pas con= tenir de chiffres !"); raise Exc_Commande; > end if; It falls outside of your if check. That means it must be in the else part. Anh Vo