Skip to content

Commit 5833669

Browse files
committed
Fix the tests on Windows
The name of the executable file on Windows must end with ".exe".
1 parent 2ae9799 commit 5833669

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/truncommand.nim

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
{.used.}
55

6-
import unittest, os, strutils
6+
import unittest, os, strutils, strformat
77
import testscommon
88
import nimblepkg/displaymessages
99
from nimblepkg/common import cd
@@ -200,7 +200,9 @@ suite "nimble run":
200200
"-d:danger", "binary", "--arg1", "--arg2")
201201
check exitCode == QuitSuccess
202202
var lines = output.processOutput
203-
check lines.inLinesOrdered("Building dependency/binary using c backend")
203+
const binaryName = when defined(windows): "binary.exe" else: "binary"
204+
check lines.inLinesOrdered(
205+
&"Building dependency/{binaryName} using c backend")
204206
check lines.inLinesOrdered("--arg1")
205207
check lines.inLinesOrdered("--arg2")
206208

@@ -228,4 +230,6 @@ suite "nimble run":
228230
let (output, exitCode) = execNimble("--package:dependency", "run",
229231
"-d:danger", "bin", "--arg1", "--arg2")
230232
check exitCode == QuitFailure
231-
check output.contains(binaryNotDefinedInPkgMsg("bin", "dependency"))
233+
const binaryName = when defined(windows): "bin.exe" else: "bin"
234+
check output.contains(binaryNotDefinedInPkgMsg(
235+
binaryName, "dependency"))

0 commit comments

Comments
 (0)