File tree Expand file tree Collapse file tree 3 files changed +34
-1
lines changed
tests/misc/other-slash-in-path Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ def match_deploy_dir(crate : str, path_fragment : str):
139139
140140def 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 } "
Original file line number Diff line number Diff line change 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" )
Original file line number Diff line number Diff line change 1+ driver : python-script
2+ indexes :
3+ compiler_only_index : {}
You can’t perform that action at this time.
0 commit comments