tb0007.pp 693 B

123456789101112131415161718192021222324252627282930
  1. { Old file: tbs0009.pp }
  2. { tests comperations in function calls a(c<0); OK 0.9.2 }
  3. var c:byte;
  4. Procedure a(b:boolean);
  5. begin
  6. if b then writeln('TRUE') else writeln('FALSE');
  7. end;
  8. function Test_a(b:boolean) : string;
  9. begin
  10. if b then Test_a:='TRUE' else Test_a:='FALSE';
  11. end;
  12. begin {main program}
  13. a(true); {works}
  14. if Test_a(true)<>'TRUE' then halt(1);
  15. a(false); {works}
  16. if Test_a(false)<>'FALSE' then halt(1);
  17. c:=0;
  18. a(c>0); {doesn't work}
  19. if Test_a(c>0)<>'FALSE' then halt(1);
  20. a(c<0); {doesn't work}
  21. if Test_a(c<0)<>'FALSE' then halt(1);
  22. a(c=0);
  23. if Test_a(c=0)<>'TRUE' then halt(1);
  24. end.