accept Windows drive letter paths in tests
on Windows Dir.pwd returns a path like "c:/some/dir", and the tests mainly cares about the suffix of the path so accepting an optional drive letter at the beginning should be ok.
This commit is contained in:
parent
9156ee3a34
commit
06b011204a
@ -24,7 +24,7 @@ class CMDTEST_chdir < Cmdtest::Testcase
|
||||
"puts Dir.pwd",
|
||||
]
|
||||
cmd_cmdtest do
|
||||
stdout_equal /^\/.*\/top\/work$/
|
||||
stdout_equal /^(?:\w:)?\/.*\/top\/work$/
|
||||
|
||||
end
|
||||
end
|
||||
@ -37,7 +37,7 @@ class CMDTEST_chdir < Cmdtest::Testcase
|
||||
"puts Dir.pwd",
|
||||
]
|
||||
cmd_cmdtest do
|
||||
stdout_equal /^\/.*\/top\/work\/SUBDIR$/
|
||||
stdout_equal /^(?:\w:)?\/.*\/top\/work\/SUBDIR$/
|
||||
|
||||
end
|
||||
end
|
||||
@ -50,7 +50,7 @@ class CMDTEST_chdir < Cmdtest::Testcase
|
||||
"puts Dir.pwd",
|
||||
]
|
||||
cmd_cmdtest do
|
||||
stdout_equal /^\/.*\/top\/work\/SUBDIR$/
|
||||
stdout_equal /^(?:\w:)?\/.*\/top\/work\/SUBDIR$/
|
||||
|
||||
end
|
||||
end
|
||||
@ -60,7 +60,7 @@ class CMDTEST_chdir < Cmdtest::Testcase
|
||||
create_CMDTEST_foo [
|
||||
"create_file 'SUBDIR/.flagfile', ''",
|
||||
"cmd 'echo_pwd.rb' do",
|
||||
" stdout_equal /^PWD=\\/.*\\/top\\/work$/",
|
||||
" stdout_equal /^PWD=(?:\\w:)?\\/.*\\/top\\/work$/",
|
||||
"end",
|
||||
]
|
||||
cmd_cmdtest do
|
||||
@ -76,7 +76,7 @@ class CMDTEST_chdir < Cmdtest::Testcase
|
||||
"create_file 'SUBDIR/.flagfile', ''",
|
||||
"chdir 'SUBDIR'",
|
||||
"cmd 'echo_pwd.rb' do",
|
||||
" stdout_equal /^PWD=\\/.*\\/top\\/work\\/SUBDIR$/",
|
||||
" stdout_equal /^PWD=(?:\\w:)?\\/.*\\/top\\/work\\/SUBDIR$/",
|
||||
"end",
|
||||
]
|
||||
cmd_cmdtest do
|
||||
|
Loading…
x
Reference in New Issue
Block a user