pastojs: fixed test on windows

This commit is contained in:
mattias 2023-07-12 13:12:15 +02:00
parent 87d084dd21
commit 322503678d
2 changed files with 7 additions and 6 deletions

View File

@ -32,6 +32,7 @@ const
// default parser+scanner options
po_tcmodules = po_Pas2js+[po_KeepScannerError];
co_tcmodules = [];
JSONNewLine = {$IFDEF Windows}'\r\n'{$ELSE}'\n'{$ENDIF};
type
TSrcMarkerKind = (
mkLabel,
@ -8877,11 +8878,11 @@ begin
CheckSource('TestStringConst_Multiline',
LinesToStr([
'this.a = "";',
'this.b = "\nline";',
'this.b = "'+JSONNewLine+'line";',
'this.c = "Single";',
'this.d = "`";',
'this.e = "abc`xyz";',
'this.f = "first''line\n second''line\n";',
'this.f = "first''line'+JSONNewLine+' second''line\n";',
'']),
LinesToStr([
]));

View File

@ -877,7 +877,7 @@ begin
AddUnit('unit1.pas',
['var a: longint;'],
['']);
AddUnit('sub/unit1.pas',
AddUnit('sub'+PathDelim+'unit1.pas',
['var b: longint;'],
['']);
AddFile('test1.pas',[
@ -887,7 +887,7 @@ begin
' a:=b;',
'end.']);
Compile(['test1.pas','-Jc'],ExitCodeSyntaxError);
AssertEquals('ErrorMsg','Duplicate file found: "'+WorkDir+'sub/unit1.pas" and "'+WorkDir+'unit1.pas"',ErrorMsg);
AssertEquals('ErrorMsg','Duplicate file found: "'+WorkDir+'sub'+PathDelim+'unit1.pas" and "'+WorkDir+'unit1.pas"',ErrorMsg);
end;
procedure TTestCLI_UnitSearch.TestUS_UsesInFile_IndirectDuplicate;
@ -897,7 +897,7 @@ begin
AddUnit('unit1.pas',
['var a: longint;'],
['']);
AddUnit('sub/unit1.pas',
AddUnit('sub'+PathDelim+'unit1.pas',
['var b: longint;'],
['']);
AddUnit('unit2.pas',
@ -908,7 +908,7 @@ begin
'begin',
'end.']);
Compile(['test1.pas','-Jc'],ExitCodeSyntaxError);
AssertEquals('ErrorMsg','Duplicate file found: "'+WorkDir+'unit1.pas" and "'+WorkDir+'sub/unit1.pas"',ErrorMsg);
AssertEquals('ErrorMsg','Duplicate file found: "'+WorkDir+'unit1.pas" and "'+WorkDir+'sub'+PathDelim+'unit1.pas"',ErrorMsg);
end;
procedure TTestCLI_UnitSearch.TestUS_UsesInFile_WorkNotEqProgDir;