@@ -36,8 +36,7 @@ internal class CoderSettingsTest {
3636 env = Environment (mapOf (
3737 " LOCALAPPDATA" to " /tmp/coder-gateway-test/localappdata" ,
3838 " HOME" to " /tmp/coder-gateway-test/home" ,
39- " XDG_DATA_HOME" to " /tmp/coder-gateway-test/xdg-data" ))
40- )
39+ " XDG_DATA_HOME" to " /tmp/coder-gateway-test/xdg-data" )))
4140 var expected = when (getOS()) {
4241 OS .WINDOWS -> " /tmp/coder-gateway-test/localappdata/coder-gateway/localhost"
4342 OS .MAC -> " /tmp/coder-gateway-test/home/Library/Application Support/coder-gateway/localhost"
@@ -52,8 +51,7 @@ internal class CoderSettingsTest {
5251 settings = CoderSettings (state,
5352 env = Environment (mapOf (
5453 " XDG_DATA_HOME" to " " ,
55- " HOME" to " /tmp/coder-gateway-test/home" ))
56- )
54+ " HOME" to " /tmp/coder-gateway-test/home" )))
5755 expected = " /tmp/coder-gateway-test/home/.local/share/coder-gateway/localhost"
5856
5957 assertEquals(Path .of(expected).toAbsolutePath(), settings.dataDir(url))
@@ -66,8 +64,7 @@ internal class CoderSettingsTest {
6664 env = Environment (mapOf (
6765 " LOCALAPPDATA" to " /ignore" ,
6866 " HOME" to " /ignore" ,
69- " XDG_DATA_HOME" to " /ignore" ))
70- )
67+ " XDG_DATA_HOME" to " /ignore" )))
7168 expected = " /tmp/coder-gateway-test/data-dir/localhost"
7269 assertEquals(Path .of(expected).toAbsolutePath(), settings.dataDir(url))
7370 assertEquals(Path .of(expected).toAbsolutePath(), settings.binPath(url).parent)
@@ -110,11 +107,10 @@ internal class CoderSettingsTest {
110107 fun testCoderConfigDir () {
111108 val state = CoderSettingsState ()
112109 var settings = CoderSettings (state,
113- env = Environment (
114- mapOf (" APPDATA" to " /tmp/coder-gateway-test/cli-appdata" ,
115- " HOME" to " /tmp/coder-gateway-test/cli-home" ,
116- " XDG_CONFIG_HOME" to " /tmp/coder-gateway-test/cli-xdg-config" ))
117- )
110+ env = Environment (mapOf (
111+ " APPDATA" to " /tmp/coder-gateway-test/cli-appdata" ,
112+ " HOME" to " /tmp/coder-gateway-test/cli-home" ,
113+ " XDG_CONFIG_HOME" to " /tmp/coder-gateway-test/cli-xdg-config" )))
118114 var expected = when (getOS()) {
119115 OS .WINDOWS -> " /tmp/coder-gateway-test/cli-appdata/coderv2"
120116 OS .MAC -> " /tmp/coder-gateway-test/cli-home/Library/Application Support/coderv2"
@@ -125,25 +121,20 @@ internal class CoderSettingsTest {
125121 // Fall back to HOME on Linux.
126122 if (getOS() == OS .LINUX ) {
127123 settings = CoderSettings (state,
128- env = Environment (
129- mapOf (" XDG_CONFIG_HOME" to " " ,
130- " HOME" to " /tmp/coder-gateway-test/cli-home" ,
131- ))
132- )
124+ env = Environment (mapOf (
125+ " XDG_CONFIG_HOME" to " " ,
126+ " HOME" to " /tmp/coder-gateway-test/cli-home" )))
133127 expected = " /tmp/coder-gateway-test/cli-home/.config/coderv2"
134128 assertEquals(Path .of(expected), settings.coderConfigDir)
135129 }
136130
137131 // Read CODER_CONFIG_DIR.
138132 settings = CoderSettings (state,
139- env = Environment (
140- mapOf (
141- " CODER_CONFIG_DIR" to " /tmp/coder-gateway-test/coder-config-dir" ,
142- " APPDATA" to " /ignore" ,
143- " HOME" to " /ignore" ,
144- " XDG_CONFIG_HOME" to " /ignore" ,
145- ))
146- )
133+ env = Environment (mapOf (
134+ " CODER_CONFIG_DIR" to " /tmp/coder-gateway-test/coder-config-dir" ,
135+ " APPDATA" to " /ignore" ,
136+ " HOME" to " /ignore" ,
137+ " XDG_CONFIG_HOME" to " /ignore" )))
147138 expected = " /tmp/coder-gateway-test/coder-config-dir"
148139 assertEquals(Path .of(expected), settings.coderConfigDir)
149140 }
0 commit comments