tb0197.pp 648 B

12345678910111213141516171819202122232425262728293031323334
  1. { Old file: tbs0233.pp }
  2. { Problem with enum sets in args OK 0.99.11 (PFV) }
  3. program except_test;
  4. type byteset = set of byte;
  5. enumset = set of (zero,one,two,three);
  6. function test(s : byteset) : boolean;
  7. begin
  8. test:=false;
  9. if 0 in s then
  10. begin
  11. Writeln('Contains zero !');
  12. test:=true;
  13. end;
  14. end;
  15. function testenum(s : enumset) : boolean;
  16. begin
  17. testenum:=false;
  18. if zero in s then
  19. begin
  20. Writeln('Contains zero !');
  21. testenum:=true;
  22. end;
  23. end;
  24. begin
  25. if test([1..5,8]) then halt(1);
  26. if not test([0,8,15]) then halt(1);
  27. if not testenum([zero,two]) then halt(1);
  28. end.