@@ -50,6 +50,9 @@ func TestFullAndIncrementalBuild(t *testing.T) { |
| 50 |
assertPage(t, full, "", `absolute >= 604800`) |
50 |
assertPage(t, full, "", `absolute >= 604800`) |
| 51 |
assertPage(t, full, "", ".dumbforge/assets/gabriel-mark.svg") |
51 |
assertPage(t, full, "", ".dumbforge/assets/gabriel-mark.svg") |
| 52 |
assertPage(t, full, "", `.dumbforge/assets/site.css?v=`+generator.AssetVersion()) |
52 |
assertPage(t, full, "", `.dumbforge/assets/site.css?v=`+generator.AssetVersion()) |
|
|
53 |
assertPage(t, full, "", `.dumbforge/branches/main.css`) |
|
|
54 |
assertPage(t, full, ".dumbforge/branches/main.css", `content: "1"`) |
|
|
55 |
assertPage(t, full, "", `class="counter" data-commit-count`) |
| 53 |
assertPage(t, full, ".dumbforge/assets/site.css", "@media (prefers-color-scheme: light)") |
56 |
assertPage(t, full, ".dumbforge/assets/site.css", "@media (prefers-color-scheme: light)") |
| 54 |
assertPage(t, full, ".dumbforge/assets/site.css", ".commit-list-message { overflow: hidden; color: var(--text);") |
57 |
assertPage(t, full, ".dumbforge/assets/site.css", ".commit-list-message { overflow: hidden; color: var(--text);") |
| 55 |
assertPage(t, full, "", `<span class="header-owner">owner</span><span>/</span>`) |
58 |
assertPage(t, full, "", `<span class="header-owner">owner</span><span>/</span>`) |
@@ -106,8 +109,8 @@ func TestFullAndIncrementalBuild(t *testing.T) { |
| 106 |
if err != nil { |
109 |
if err != nil { |
| 107 |
t.Fatal(err) |
110 |
t.Fatal(err) |
| 108 |
} |
111 |
} |
| 109 |
if len(incremental.Pages) != 6 { |
112 |
if len(incremental.Pages) != 7 { |
| 110 |
t.Fatalf("incremental build generated %d pages, want 6", len(incremental.Pages)) |
113 |
t.Fatalf("incremental build generated %d pages, want 7", len(incremental.Pages)) |
| 111 |
} |
114 |
} |
| 112 |
for _, page := range incremental.Pages { |
115 |
for _, page := range incremental.Pages { |
| 113 |
if strings.HasPrefix(page.Route, ".dumbforge/assets/") || page.Route == ".dumbforge/site-version" { |
116 |
if strings.HasPrefix(page.Route, ".dumbforge/assets/") || page.Route == ".dumbforge/site-version" { |
@@ -119,6 +122,7 @@ func TestFullAndIncrementalBuild(t *testing.T) { |
| 119 |
assertPage(t, incremental, "tree/main/src", `commit/`+second+`" title="change one file">change one file</a>`) |
122 |
assertPage(t, incremental, "tree/main/src", `commit/`+second+`" title="change one file">change one file</a>`) |
| 120 |
assertPage(t, incremental, "", `commit/`+first+`" title="initial">initial</a>`) |
123 |
assertPage(t, incremental, "", `commit/`+first+`" title="initial">initial</a>`) |
| 121 |
assertPage(t, incremental, "commits/main", "change one file") |
124 |
assertPage(t, incremental, "commits/main", "change one file") |
|
|
125 |
assertPage(t, incremental, ".dumbforge/branches/main.css", `content: "2"`) |
| 122 |
assertPage(t, incremental, "commit/"+second, `class="diff-code old deletion`) |
126 |
assertPage(t, incremental, "commit/"+second, `class="diff-code old deletion`) |
| 123 |
assertPage(t, incremental, "commit/"+second, `class="diff-kd"`) |
127 |
assertPage(t, incremental, "commit/"+second, `class="diff-kd"`) |
| 124 |
assertPage(t, incremental, "commit/"+second, `changed`) |
128 |
assertPage(t, incremental, "commit/"+second, `changed`) |
@@ -223,7 +227,7 @@ func TestRepositoryNavigationBuild(t *testing.T) { |
| 223 |
} |
227 |
} |
| 224 |
assertPage(t, build, ".dumbforge/repository.json", `"defaultBranch":"main"`) |
228 |
assertPage(t, build, ".dumbforge/repository.json", `"defaultBranch":"main"`) |
| 225 |
assertPage(t, build, ".dumbforge/repository.json", `"branches":["main","topic"]`) |
229 |
assertPage(t, build, ".dumbforge/repository.json", `"branches":["main","topic"]`) |
| 226 |
if len(build.Deletes) != 1 || build.Deletes[0] != ".dumbforge/files/old.json" { |
230 |
if len(build.Deletes) != 2 || build.Deletes[0] != ".dumbforge/files/old.json" || build.Deletes[1] != ".dumbforge/branches/old.css" { |
| 227 |
t.Fatalf("navigation deletes = %#v", build.Deletes) |
231 |
t.Fatalf("navigation deletes = %#v", build.Deletes) |
| 228 |
} |
232 |
} |
| 229 |
} |
233 |
} |