* Test for const list

This commit is contained in:
Michaël Van Canneyt 2022-02-07 16:30:28 +01:00
parent cb03124cc5
commit c8403ad49e

View File

@ -101,6 +101,7 @@ type
Procedure TestConstDeclarationStatement;
Procedure TestDebuggerStatement;
Procedure TestVarListDeclarationStatement;
Procedure TestConstListDeclarationStatement;
Procedure TestVarListDeclarationStatement2Vars;
Procedure TestVarListDeclarationStatement3Vars;
Procedure TestReturnStatement;
@ -1058,6 +1059,23 @@ begin
AssertWrite('simple var','var a',S);
end;
procedure TTestStatementWriter.TestConstListDeclarationStatement;
Var
S : TJSVariableStatement;
V : TJSVarDeclaration;
L : TJSVariableDeclarationList;
begin
S:=TJSVariableStatement.Create(0,0);
L:=TJSVariableDeclarationList.Create(0,0);
V:=TJSVarDeclaration.Create(0,0);
S.VarType:=vtConst;
L.A:=V;
S.VarDecl:=L;
V.Name:='a';
AssertWrite('simple const','const a',S);
end;
procedure TTestStatementWriter.TestVarListDeclarationStatement2Vars;
Var
S : TJSVariableStatement;