mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-08 22:55:07 +02:00
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:
@ -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)
|
||||
|
Reference in New Issue
Block a user