File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ Deno.test("useConfig", () => {
1212 assertEquals ( config . UserAgent , "libpkgx" )
1313 }
1414
15-
1615 const PKGX_PANTRY_PATH = Deno . build . os == 'windows' ? "C:\\foo;D:\\bar" : "/foo:/bar"
1716
1817 config = ConfigDefault ( { PKGX_PANTRY_PATH , CI : "true" } )
@@ -45,3 +44,20 @@ Deno.test("useConfig empty PKGX_PANTRY_PATH is ignored", () => {
4544 assertEquals ( ConfigDefault ( { PKGX_PANTRY_PATH : "" } ) . pantries , [ ] )
4645 assertEquals ( ConfigDefault ( { PKGX_PANTRY_PATH : ` ${ SEP } ${ SEP } ` } ) . pantries , [ ] )
4746} )
47+
48+ Deno . test ( "pkgx^2 rules" , ( ) => {
49+ switch ( Deno . build . os ) {
50+ case 'windows' :
51+ assertEquals ( ConfigDefault ( { XDG_DATA_HOME : "C:\\foo" } ) . data , Path . home ( ) . join ( "AppData/Local" ) ) ;
52+ assertEquals ( ConfigDefault ( ) . data , Path . home ( ) . join ( "AppData/Local" ) ) ;
53+ break ;
54+ case 'darwin' :
55+ assertEquals ( ConfigDefault ( { XDG_DATA_HOME : "/foo" } ) . data , Path . home ( ) . join ( "Library/Application Support/pkgx" ) ) ;
56+ assertEquals ( ConfigDefault ( ) . data , Path . home ( ) . join ( "Library/Application Support/pkgx" ) ) ;
57+ break ;
58+ case 'linux' :
59+ assertEquals ( ConfigDefault ( { XDG_DATA_HOME : "/foo" } ) . data , new Path ( "/foo/pkgx" ) ) ;
60+ assertEquals ( ConfigDefault ( ) . data , Path . home ( ) . join ( ".local/share/pkgx" ) ) ;
61+ break ;
62+ }
63+ } )
You can’t perform that action at this time.
0 commit comments