comp.lang.ada
 help / color / mirror / Atom feed
From: WOLF%cs.umass.edu@CSNET-RELAY.ARPA ("Alexander L. Wolf")
Subject: Missing ACVC test?  ("Now that's picky!")
Date: Thu, 21-Aug-86 10:54:00 EDT	[thread overview]
Date: Thu Aug 21 10:54:00 1986
Message-ID: <8608220641.AA10941@ucbvax.Berkeley.EDU> (raw)

Here's a real simple one that the validation suite must not be testing for
(at least, it wasn't caught in the DEC Ada compiler):  'Value is defined to
ignore leading and trailing spaces in its parameter of type String.

  with Text_IO; use Text_IO;
procedure TestValue is
  type E is ( E1, E2, E3 );

  S1 : String ( 1 .. 2 ) := "E1";
  S2 : String ( 1 .. 3 ) := " E2";
  S3 : String ( 1 .. 3 ) := "E3 ";

begin
  if E'Value ( S1 ) = E1 then
    Put_Line ( "S1 = E1" );
  else
    Put_Line ( "S1 /= E1" );
  end if;

  if E'Value ( S2 ) = E2 then
    Put_Line ( "S2 = E2" );
  else
    Put_Line ( "S2 /= E2" );
  end if;

  if E'Value ( S3 ) = E3 then   -- raises Constraint_Error using DEC Ada
    Put_Line ( "S3 = E3" );
  else
    Put_Line ( "S3 /= E3" );
  end if;

end TestValue;

             reply	other threads:[~1986-08-21 14:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1986-08-21 14:54 "Alexander L. Wolf" [this message]
  -- strict thread matches above, loose matches on Subject: below --
1986-08-22 12:37 Missing ACVC test? ("Now that's picky!") John B. Goodenough
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox