Skip to content

Commit ee7b9fe

Browse files
committed
New test
1 parent 958ccd6 commit ee7b9fe

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

testsuite/drivers/asserts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def match_deploy_dir(crate : str, path_fragment : str):
139139

140140
def assert_substring(target: str, text: str):
141141
"""
142-
Check that a string is contained in another string
142+
Check that a target string is contained in a given text
143143
"""
144144
assert target in text, \
145145
f"Missing expected string '{target}' in text:\n{text}"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""
2+
Check that slashes from other OSes in paths are handled correctly.
3+
Fix for issue #1984
4+
"""
5+
6+
import os
7+
from drivers.alr import run_alr
8+
from drivers.asserts import assert_substring
9+
from drivers.helpers import on_windows
10+
11+
BAD_SLASH = '/' if on_windows() else '\\'
12+
BAD_DIR = f"test{BAD_SLASH}crate"
13+
14+
# Initialize a crate in place within a directory with the contrary slash
15+
# to the one used by the current OS.
16+
17+
os.mkdir(BAD_DIR)
18+
os.chdir(BAD_DIR)
19+
run_alr("init", "testcrate", "--bin", "--in-place")
20+
21+
# Check we are were we expect to be
22+
assert_substring(BAD_DIR, os.getcwd())
23+
24+
# Check that it can be shown
25+
p = run_alr("show")
26+
27+
# Verify the crate name is in the output
28+
assert_substring("testcrate=0.1.0-dev", p.out)
29+
30+
print("SUCCESS")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
driver: python-script
2+
indexes:
3+
compiler_only_index: {}

0 commit comments

Comments
 (0)