summaryrefslogtreecommitdiff
path: root/t/trivial.pas
diff options
context:
space:
mode:
authorNagi5Yeq <wu@x-nagi.com>2020-06-05 01:25:59 +0800
committerNagi5Yeq <wu@x-nagi.com>2020-06-05 01:25:59 +0800
commit176c8e70f56bbbbe5ab2063f22000b9af0180e85 (patch)
tree0f291a33e69bd9c840131e170e63c0d245268d7b /t/trivial.pas
parentbaa601da82cce51d2b4bd39a32fdc5b8de5c6452 (diff)
add case statement support
Diffstat (limited to 't/trivial.pas')
-rw-r--r--t/trivial.pas16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/trivial.pas b/t/trivial.pas
index 52a6ebe..e71d037 100644
--- a/t/trivial.pas
+++ b/t/trivial.pas
@@ -230,3 +230,19 @@ begin
pa^.m4[1].m1[2]:=1234;
record_test:=a.m3[6]+pa^.m3[a.m1]+a.m4[1].m1[2];
end;
+
+function case_test(a:integer):integer;
+begin
+ case a of
+ 1,2,3:case_test:=111;
+ 4,5,6:case a of
+ 4:case_test:=222;
+ 5,6:case a of
+ 5:case_test:=333;
+ 6:case_test:=555;
+ end;
+ end;
+ else
+ case_test:=666;
+ end
+end;