From 06b011204aef426e64a766a66e6d958c9b1c41ab Mon Sep 17 00:00:00 2001 From: Johan Holmberg Date: Mon, 7 Nov 2016 09:25:27 +0100 Subject: [PATCH] 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. --- t/CMDTEST_chdir.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/CMDTEST_chdir.rb b/t/CMDTEST_chdir.rb index 99cf42f..53737ea 100644 --- a/t/CMDTEST_chdir.rb +++ b/t/CMDTEST_chdir.rb @@ -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