detached 6af0a61

config_test.go RawHistoryFolder

1package config
2
3import "testing"
4
5func TestNewConfig_UsesReleaseVersionAsBootstrapRef(t *testing.T) {
6	cfg := NewConfig("v1.2.3")
7
8	if cfg.RawURL != "https://raw.githubusercontent.com/bnema/archup/v1.2.3" {
9		t.Fatalf("expected release raw URL, got %q", cfg.RawURL)
10	}
11
12	if cfg.Branch() != "v1.2.3" {
13		t.Fatalf("expected release ref, got %q", cfg.Branch())
14	}
15}
16
17func TestNewConfig_UsesDevRefForDevelopmentBuilds(t *testing.T) {
18	cfg := NewConfig("v1.2.3-dev")
19
20	if cfg.RawURL != "https://raw.githubusercontent.com/bnema/archup/dev" {
21		t.Fatalf("expected dev raw URL, got %q", cfg.RawURL)
22	}
23
24	if cfg.Branch() != "dev" {
25		t.Fatalf("expected dev ref, got %q", cfg.Branch())
26	}
27}
28
29func TestNewConfig_GoReleaserVersionWithoutVPrefix(t *testing.T) {
30	// GoReleaser strips the 'v' prefix: version={{.Version}} yields "0.5.1" not "v0.5.1".
31	cfg := NewConfig("0.5.1")
32
33	if cfg.RawURL != "https://raw.githubusercontent.com/bnema/archup/v0.5.1" {
34		t.Fatalf("expected v-prefixed raw URL, got %q", cfg.RawURL)
35	}
36
37	if cfg.Branch() != "v0.5.1" {
38		t.Fatalf("expected v-prefixed branch, got %q", cfg.Branch())
39	}
40}
41
42func TestNewConfig_ENVDevOverridesReleaseVersion(t *testing.T) {
43	t.Setenv("ENV", "dev")
44
45	cfg := NewConfig("v1.2.3")
46
47	if cfg.RawURL != "https://raw.githubusercontent.com/bnema/archup/dev" {
48		t.Fatalf("expected dev raw URL override, got %q", cfg.RawURL)
49	}
50
51	if cfg.Branch() != "dev" {
52		t.Fatalf("expected dev ref override, got %q", cfg.Branch())
53	}
54}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close