From 322503678d0522ba5aa513c863d7f81e336df652 Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 12 Jul 2023 13:12:15 +0200 Subject: [PATCH] pastojs: fixed test on windows --- packages/pastojs/tests/tcmodules.pas | 5 +++-- packages/pastojs/tests/tcunitsearch.pas | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/pastojs/tests/tcmodules.pas b/packages/pastojs/tests/tcmodules.pas index 853e7fc80e..7a5c3fc7b1 100644 --- a/packages/pastojs/tests/tcmodules.pas +++ b/packages/pastojs/tests/tcmodules.pas @@ -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([ ])); diff --git a/packages/pastojs/tests/tcunitsearch.pas b/packages/pastojs/tests/tcunitsearch.pas index ea79f8f9a2..c6d0182fac 100644 --- a/packages/pastojs/tests/tcunitsearch.pas +++ b/packages/pastojs/tests/tcunitsearch.pas @@ -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;