Browse Source

* runtime check

peter 22 years ago
parent
commit
133a9aa958
1 changed files with 10 additions and 1 deletions
  1. 10 1
      tests/webtbs/tw2306.pp

+ 10 - 1
tests/webtbs/tw2306.pp

@@ -7,10 +7,11 @@ Const LONG_STR_SIZE=4096;
 
 Type tLongStr=Object  // try to change this
                       // to Record
-        LStr:Array[1..LONG_STR_SIZE] Of Char;
+        LStr:Array[0..LONG_STR_SIZE] Of Char;
         LLength:Longint;
      End;
 
+
 Operator := (S:String) R:tLongStr;
 Begin
    R.LLength:=Length(S);
@@ -21,4 +22,12 @@ Var T:tLongStr;
 
 Begin
    T:='Hello';
+   if (T.LLength<>5) or
+      (T.LStr[1]<>'H') or
+      (T.LStr[5]<>'o') then
+    begin
+      writeln('Error!');
+      halt(1);
+    end;
+
 End.