Skip to content

Commit f9edd57

Browse files
committed
chore: added tests for windows
1 parent 94d562f commit f9edd57

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

tests/test_comments.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import subprocess
23

34

@@ -7,11 +8,19 @@ def test_comments() -> None:
78
stdout=subprocess.PIPE,
89
check=False,
910
)
10-
assert result.stdout == b"Hello World!\n"
11+
12+
if os.name == "nt":
13+
assert result.stdout == b"Hello World!\r\n"
14+
else:
15+
assert result.stdout == b"Hello World!\n"
1116

1217
result = subprocess.run(
1318
["valthon", "tests/comments.vln"],
1419
stdout=subprocess.PIPE,
1520
check=False,
1621
)
17-
assert result.stdout == b"Hello World!\n"
22+
23+
if os.name == "nt":
24+
assert result.stdout == b"Hello World!\r\n"
25+
else:
26+
assert result.stdout == b"Hello World!\n"

tests/test_function.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import subprocess
23

34

@@ -7,11 +8,19 @@ def test_function() -> None:
78
stdout=subprocess.PIPE,
89
check=False,
910
)
10-
assert result.stdout == b"Hello World!\n"
11+
12+
if os.name == "nt":
13+
assert result.stdout == b"Hello World!\r\n"
14+
else:
15+
assert result.stdout == b"Hello World!\n"
1116

1217
result = subprocess.run(
1318
["valthon", "tests/function.vln"],
1419
stdout=subprocess.PIPE,
1520
check=False,
1621
)
17-
assert result.stdout == b"Hello World!\n"
22+
23+
if os.name == "nt":
24+
assert result.stdout == b"Hello World!\r\n"
25+
else:
26+
assert result.stdout == b"Hello World!\n"

tests/test_imports.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import subprocess
23

34

@@ -7,11 +8,19 @@ def test_function() -> None:
78
stdout=subprocess.PIPE,
89
check=False,
910
)
10-
assert result.stdout == b"1\n"
11+
12+
if os.name == "nt":
13+
assert result.stdout == b"1\r\n"
14+
else:
15+
assert result.stdout == b"1\n"
1116

1217
result = subprocess.run(
1318
["valthon", "tests/imports.vln"],
1419
stdout=subprocess.PIPE,
1520
check=False,
1621
)
17-
assert result.stdout == b"1\n"
22+
23+
if os.name == "nt":
24+
assert result.stdout == b"1\r\n"
25+
else:
26+
assert result.stdout == b"1\n"

0 commit comments

Comments
 (0)