From: Anh Vo <anhvofrcaus@gmail.com>
Subject: Re: alternative elsif branch not tested
Date: Thu, 22 Feb 2018 15:29:40 -0800 (PST)
Date: 2018-02-22T15:29:40-08:00 [thread overview]
Message-ID: <dba1e7ed-eb8e-4c6a-a3cd-19be47e9b00b@googlegroups.com> (raw)
In-Reply-To: <fd7c28a6-5605-4521-b9e9-f88b47b9714d@googlegroups.com>
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 whatever 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'.
>
> if Argument_Count /= 2 then PUT_LINE ("Pas le bon nombre d'arguments."); raise Exc_Commande;
> elsif Argument (1)'Length /= 1 and ARGUMENT(1)(1) not in 'n'| 'c'| 'N' | 'C' then
> PUT_LINE ("Première argument incorrect: veuillez mettre un (seul) charactère entre n, c, N et C."); raise Exc_Commande;
> elsif ADA.Strings.Fixed.Index (Argument (2), Alphanumeric_Set, Outside) /= 0 then
> PUT_LINE ("Deuxième argument incorrect: l'acronyme ne peut pas contenir 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
next prev parent reply other threads:[~2018-02-22 23:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-22 22:54 alternative elsif branch not tested Mehdi Saada
2018-02-22 23:09 ` Mehdi Saada
2018-02-22 23:29 ` Anh Vo [this message]
2018-02-22 23:54 ` Randy Brukardt
2018-02-23 10:51 ` Mehdi Saada
2018-02-23 11:04 ` briot.emmanuel
2018-02-23 17:34 ` Jeffrey R. Carter
2018-02-23 19:31 ` Mehdi Saada
2018-02-23 19:39 ` Mehdi Saada
2018-02-23 19:53 ` Jeffrey R. Carter
2018-02-23 20:25 ` Mehdi Saada
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox