Skip to content

Commit

Permalink
[tests] Avoid cppia args/programPath bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tobil4sk committed Jan 16, 2025
1 parent caf83fa commit 53f7f98
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tests/sys/src/TestArguments.hx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class TestArguments extends utest.Test {
#end

function testArgs() {
var args = Sys.args();
var args = Sys.args() #if cppia .slice(1) #end;
for (i in 0...expectedArgs.length) {
Assert.equals(expectedArgs[i], args[i]);
}
Expand Down
10 changes: 3 additions & 7 deletions tests/sys/src/TestSys.hx
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,10 @@ class TestSys extends TestCommandBase {
Assert.isTrue(StringTools.endsWith(p, "sys.n"));
#elseif cpp
#if cppia
Assert.isTrue(StringTools.endsWith(p, "Main.cppia"));
// Assert.isTrue(StringTools.endsWith(p, "Main.cppia"));
Assert.isTrue(StringTools.endsWith(p, "Host-debug" + (Sys.systemName() == "Windows" ? ".exe" : "")));
#else
switch (Sys.systemName()) {
case "Windows":
Assert.isTrue(StringTools.endsWith(p, "Main-debug.exe"));
case _:
Assert.isTrue(StringTools.endsWith(p, "Main-debug"));
}
Assert.isTrue(StringTools.endsWith(p, "Main-debug" + (Sys.systemName() == "Windows" ? ".exe" : "")));
#end
#elseif jvm
Assert.isTrue(StringTools.endsWith(p, "sys.jar"));
Expand Down
2 changes: 1 addition & 1 deletion tests/sys/src/UtilityProcess.hx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class UtilityProcess {
}

public static function main():Void {
var args = Sys.args();
var args = Sys.args() #if cppia .slice(1) #end;
function sequenceIndex(d:String, mode:String):String
return switch UnicodeSequences.valid[Std.parseInt(d)] {
case Only(ref): UnicodeSequences.codepointsToString(ref);
Expand Down

0 comments on commit 53f7f98

Please sign in to comment.