(t *testing.T)
| 180 | } |
| 181 | |
| 182 | func TestQuerySystemEnvironmentVariable(t *testing.T) { |
| 183 | // Test with a known environment variable |
| 184 | key := "PATH" |
| 185 | value, err := QuerySystemEnvironmentVariable(key) |
| 186 | if err != nil { |
| 187 | t.Errorf("QuerySystemEnvironmentVariable failed: %v", err) |
| 188 | } |
| 189 | |
| 190 | if value == "" { |
| 191 | t.Errorf("Expected non-empty PATH, got empty string") |
| 192 | } |
| 193 | |
| 194 | // Test with non-existent variable |
| 195 | nonExistentKey := "JENV_TEST_NON_EXISTENT_VAR" |
| 196 | value, err = QuerySystemEnvironmentVariable(nonExistentKey) |
| 197 | if err != nil { |
| 198 | // This is expected for non-existent variables |
| 199 | t.Logf("Expected error for non-existent variable: %v", err) |
| 200 | } |
| 201 | |
| 202 | if value != "" { |
| 203 | t.Errorf("Expected empty value for non-existent variable, got: %s", value) |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | func TestUpdateShellConfigFile(t *testing.T) { |
| 208 | // Create a temporary file |
nothing calls this directly
no test coverage detected