(t *testing.T)
| 140 | } |
| 141 | |
| 142 | func TestLoadBasePathFromEnv(t *testing.T) { |
| 143 | t.Setenv("ZENNOTES_AUTH_TOKEN", "") |
| 144 | t.Setenv("ZENNOTES_CONFIG_PATH", filepath.Join(t.TempDir(), "missing.json")) |
| 145 | t.Setenv("ZENNOTES_BASE_PATH", "/zennotes/") |
| 146 | cfg := Load() |
| 147 | if cfg.BasePath != "/zennotes" { |
| 148 | t.Fatalf("BasePath = %q, want /zennotes (trailing slash trimmed)", cfg.BasePath) |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | func TestParseFileModeEnv(t *testing.T) { |
| 153 | cases := []struct { |