Make TUI always take exactly the full width of the terminal through more precise calculations of the overhead used for the table (#136)

* Make TUI always take exactly the full width of the terminal through more precise calculations of the overhead used for the table

* Update TUI goldens for more accurate TUI sizing

* More golden updates for wider table sizing

* Include failed test goldens as artifacts for easier test fixing on github actions
This commit is contained in:
David Dworken
2023-12-03 13:15:38 -08:00
committed by GitHub
parent 5f694da421
commit bdaf0f8a65
16 changed files with 302 additions and 292 deletions

View File

@ -370,6 +370,10 @@ func CompareGoldens(t testing.TB, out, goldenName string) {
}
}
if diff := cmp.Diff(string(expected), out); diff != "" {
if err := os.Mkdir("/tmp/test-goldens", os.ModePerm); err != nil {
log.Fatal(err)
}
require.NoError(t, os.WriteFile(path.Join("/tmp/test-goldens", goldenName), []byte(out), 0644))
if os.Getenv("HISHTORY_UPDATE_GOLDENS") == "" {
_, filename, line, _ := runtime.Caller(1)
t.Fatalf("hishtory golden mismatch for %s at %s:%d (-expected +got):\n%s\nactual=\n%s", goldenName, filename, line, diff, out)