mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 19:29:09 +02:00
* test val input
git-svn-id: trunk@7123 -
This commit is contained in:
parent
0b8e1aa0b4
commit
02d329cf4f
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8126,6 +8126,7 @@ tests/webtbs/tw8156.pp svneol=native#text/plain
|
||||
tests/webtbs/tw8171.pp svneol=native#text/plain
|
||||
tests/webtbs/tw8172.pp svneol=native#text/plain
|
||||
tests/webtbs/tw8177.pp svneol=native#text/plain
|
||||
tests/webtbs/tw8177a.pp -text
|
||||
tests/webtbs/tw8180.pp svneol=native#text/plain
|
||||
tests/webtbs/tw8183.pp svneol=native#text/plain
|
||||
tests/webtbs/tw8187.pp svneol=native#text/plain
|
||||
|
30
tests/webtbs/tw8177a.pp
Normal file
30
tests/webtbs/tw8177a.pp
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
|
||||
var
|
||||
S : string;
|
||||
i : longint;
|
||||
err : word;
|
||||
begin
|
||||
S:='';
|
||||
val(S,i,err);
|
||||
if err=0 then
|
||||
begin
|
||||
Writeln('Error: empty string is a valid input for val function');
|
||||
Halt(1);
|
||||
end
|
||||
else
|
||||
begin
|
||||
Writeln('Correct: empty string is a not valid input for val function');
|
||||
end;
|
||||
S:=#0;
|
||||
val(S,i,err);
|
||||
if err=0 then
|
||||
begin
|
||||
Writeln('Error: #0 string is a valid input for val function');
|
||||
Halt(1);
|
||||
end
|
||||
else
|
||||
begin
|
||||
Writeln('Correct: #0 string is a not valid input for val function');
|
||||
end;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user