mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 09:39:25 +02:00
* fix case of string with ranges as labels
+ add test git-svn-id: trunk@38860 -
This commit is contained in:
parent
52e7678033
commit
cfa373a8cf
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -11521,6 +11521,7 @@ tests/tbs/tb0637.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0638.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0639.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0641.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0642.pp svneol=native#text/pascal
|
||||
tests/tbs/tb205.pp svneol=native#text/plain
|
||||
tests/tbs/tb610.pp svneol=native#text/pascal
|
||||
tests/tbs/tb613.pp svneol=native#text/plain
|
||||
|
@ -723,7 +723,7 @@ implementation
|
||||
newcheck:=@check;
|
||||
labitem:=TLinkedListCaseLabelItem(lablist[j]).casenode;
|
||||
newcheck^:=caddnode.create(equaln,left.getcopy,labitem^._low_str.getcopy);
|
||||
if (labtree^._low_str.fullcompare(labtree^._high_str)<>0) then
|
||||
if (labitem^._low_str.fullcompare(labitem^._high_str)<>0) then
|
||||
begin
|
||||
newcheck^.nodetype:=gten;
|
||||
newcheck^:=caddnode.create(
|
||||
|
42
tests/tbs/tb0642.pp
Normal file
42
tests/tbs/tb0642.pp
Normal file
@ -0,0 +1,42 @@
|
||||
program tb0642;
|
||||
{$mode objfpc}
|
||||
{$h+}
|
||||
|
||||
type
|
||||
TResult = (
|
||||
resFirst,
|
||||
resSecond,
|
||||
resElse
|
||||
);
|
||||
|
||||
function Test(const aStr: String): TResult;
|
||||
begin
|
||||
case aStr of
|
||||
'Hello', 'Hello2': Exit(resFirst);
|
||||
'a'..'z': Exit(resSecond);
|
||||
else
|
||||
Exit(resElse);
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
if Test('Hello') <> resFirst then
|
||||
Halt(1);
|
||||
if Test('Hello2') <> resFirst then
|
||||
Halt(2);
|
||||
if Test('a') <> resSecond then
|
||||
Halt(3);
|
||||
if Test('z') <> resSecond then
|
||||
Halt(4);
|
||||
if Test('g') <> resSecond then
|
||||
Halt(5);
|
||||
if Test('alpha') <> resSecond then
|
||||
Halt(6);
|
||||
if Test('zeta') <> resElse then
|
||||
Halt(7);
|
||||
if Test('A') <> resElse then
|
||||
Halt(8);
|
||||
if Test('1') <> resElse then
|
||||
Halt(9);
|
||||
Writeln('ok');
|
||||
end.
|
Loading…
Reference in New Issue
Block a user