@@ -605,6 +605,21 @@ public void LogDirectoryOptionSupportsRelativePaths(string path)
605605 Assert . AreEqual ( expectedPath , actualPath ) ;
606606 }
607607
608+ [ Test ]
609+ [ TestCase ( ".\\ Any\\ Directory\\ Path" ) ]
610+ [ TestCase ( "..\\ Any\\ Directory\\ Path" ) ]
611+ [ TestCase ( "..\\ ..\\ Any\\ Directory\\ Path" ) ]
612+ public void LogDirectoryOptionSupportsRelativePathsInDefaultValues ( string path )
613+ {
614+ Option option = OptionFactory . CreateLogDirectoryOption ( defaultValue : path ) ;
615+ ParseResult result = option . Parse ( $ "--profile=ANY-PROFILE.json") ;
616+
617+ string expectedPath = Path . GetFullPath ( path ) ;
618+ string actualPath = result . ValueForOption ( "--log-dir" ) ? . ToString ( ) ;
619+
620+ Assert . AreEqual ( expectedPath , actualPath ) ;
621+ }
622+
608623 [ Test ]
609624 [ TestCase ( "--log-level" ) ]
610625 [ TestCase ( "--ll" ) ]
@@ -813,6 +828,21 @@ public void PackageDirectoryOptionSupportsRelativePaths(string path)
813828 Assert . AreEqual ( expectedPath , actualPath ) ;
814829 }
815830
831+ [ Test ]
832+ [ TestCase ( ".\\ Any\\ Directory\\ Path" ) ]
833+ [ TestCase ( "..\\ Any\\ Directory\\ Path" ) ]
834+ [ TestCase ( "..\\ ..\\ Any\\ Directory\\ Path" ) ]
835+ public void PackageDirectoryOptionSupportsRelativePathsInDefaultValues ( string path )
836+ {
837+ Option option = OptionFactory . CreatePackageDirectoryOption ( defaultValue : path ) ;
838+ ParseResult result = option . Parse ( $ "--profile=ANY-PROFILE.json") ;
839+
840+ string expectedPath = Path . GetFullPath ( path ) ;
841+ string actualPath = result . ValueForOption ( "--package-dir" ) ? . ToString ( ) ;
842+
843+ Assert . AreEqual ( expectedPath , actualPath ) ;
844+ }
845+
816846 [ Test ]
817847 [ TestCase ( "--package-store" ) ]
818848 [ TestCase ( "--packageStore" ) ]
@@ -1184,6 +1214,21 @@ public void StateDirectoryOptionSupportsRelativePaths(string path)
11841214 Assert . AreEqual ( expectedPath , actualPath ) ;
11851215 }
11861216
1217+ [ Test ]
1218+ [ TestCase ( ".\\ Any\\ Directory\\ Path" ) ]
1219+ [ TestCase ( "..\\ Any\\ Directory\\ Path" ) ]
1220+ [ TestCase ( "..\\ ..\\ Any\\ Directory\\ Path" ) ]
1221+ public void StateDirectoryOptionSupportsRelativePathsInDefaultValues ( string path )
1222+ {
1223+ Option option = OptionFactory . CreateStateDirectoryOption ( defaultValue : path ) ;
1224+ ParseResult result = option . Parse ( $ "--profile=ANY-PROFILE.json") ;
1225+
1226+ string expectedPath = Path . GetFullPath ( path ) ;
1227+ string actualPath = result . ValueForOption ( "--state-dir" ) ? . ToString ( ) ;
1228+
1229+ Assert . AreEqual ( expectedPath , actualPath ) ;
1230+ }
1231+
11871232 [ Test ]
11881233 [ TestCase ( "--system" ) ]
11891234 [ TestCase ( "--s" ) ]
@@ -1234,6 +1279,21 @@ public void TargetDirectoryOptionSupportsRelativePaths(string path)
12341279 Assert . AreEqual ( expectedPath , actualPath ) ;
12351280 }
12361281
1282+ [ Test ]
1283+ [ TestCase ( ".\\ Any\\ Directory\\ Path" ) ]
1284+ [ TestCase ( "..\\ Any\\ Directory\\ Path" ) ]
1285+ [ TestCase ( "..\\ ..\\ Any\\ Directory\\ Path" ) ]
1286+ public void TargetDirectoryOptionSupportsRelativePathsInDefaultValues ( string path )
1287+ {
1288+ Option option = OptionFactory . CreateTargetDirectoryOption ( defaultValue : path ) ;
1289+ ParseResult result = option . Parse ( $ "--profile=ANY-PROFILE.json") ;
1290+
1291+ string expectedPath = Path . GetFullPath ( path ) ;
1292+ string actualPath = result . ValueForOption ( "--directory" ) ? . ToString ( ) ;
1293+
1294+ Assert . AreEqual ( expectedPath , actualPath ) ;
1295+ }
1296+
12371297 [ Test ]
12381298 [ TestCase ( "--files" ) ]
12391299 public void TargetFilesOptionSupportsExpectedAliases ( string alias )
@@ -1347,6 +1407,21 @@ public void TempDirectoryOptionSupportsRelativePaths(string path)
13471407 Assert . AreEqual ( expectedPath , actualPath ) ;
13481408 }
13491409
1410+ [ Test ]
1411+ [ TestCase ( ".\\ Any\\ Directory\\ Path" ) ]
1412+ [ TestCase ( "..\\ Any\\ Directory\\ Path" ) ]
1413+ [ TestCase ( "..\\ ..\\ Any\\ Directory\\ Path" ) ]
1414+ public void TempDirectoryOptionSupportsRelativePathsInDefaultValues ( string path )
1415+ {
1416+ Option option = OptionFactory . CreateTempDirectoryOption ( defaultValue : path ) ;
1417+ ParseResult result = option . Parse ( $ "--profile=ANY-PROFILE.json") ;
1418+
1419+ string expectedPath = Path . GetFullPath ( path ) ;
1420+ string actualPath = result . ValueForOption ( "--temp-dir" ) ? . ToString ( ) ;
1421+
1422+ Assert . AreEqual ( expectedPath , actualPath ) ;
1423+ }
1424+
13501425 [ Test ]
13511426 [ TestCase ( "--timeout" ) ]
13521427 [ TestCase ( "--t" ) ]
0 commit comments