summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-04-06 08:18:57 +1000
committerJesse Duffield <jessedduffield@gmail.com>2021-04-06 19:34:32 +1000
commit28ffaf93488756f9d257d07e8b7eae9dbd9fb8ad (patch)
tree6cb3340217a5bfe730bc9bcb6625acf071ef8dd5 /pkg
parentd7da6dde0eac7f67350af7292873f976559899f3 (diff)
tiny refactor
Diffstat (limited to 'pkg')
-rw-r--r--pkg/gui/gui_test.go3
-rw-r--r--pkg/integration/integration.go7
2 files changed, 5 insertions, 5 deletions
diff --git a/pkg/gui/gui_test.go b/pkg/gui/gui_test.go
index c6f945ae9..677b77f7c 100644
--- a/pkg/gui/gui_test.go
+++ b/pkg/gui/gui_test.go
@@ -57,7 +57,8 @@ func Test(t *testing.T) {
test := test
t.Run(test.Name, func(t *testing.T) {
- speeds := integration.GetTestSpeeds(test.Speed, updateSnapshots)
+ speedEnv := os.Getenv("SPEED")
+ speeds := integration.GetTestSpeeds(test.Speed, updateSnapshots, speedEnv)
testPath := filepath.Join(testDir, test.Name)
actualDir := filepath.Join(testPath, "actual")
expectedDir := filepath.Join(testPath, "expected")
diff --git a/pkg/integration/integration.go b/pkg/integration/integration.go
index e7e21bbd7..e433f1954 100644
--- a/pkg/integration/integration.go
+++ b/pkg/integration/integration.go
@@ -79,15 +79,14 @@ func TempLazygitPath() string {
return filepath.Join("/tmp", "lazygit", "test_lazygit")
}
-func GetTestSpeeds(testStartSpeed float64, updateSnapshots bool) []float64 {
+func GetTestSpeeds(testStartSpeed float64, updateSnapshots bool, speedStr string) []float64 {
if updateSnapshots {
// have to go at original speed if updating snapshots in case we go to fast and create a junk snapshot
return []float64{1.0}
}
- speedEnv := os.Getenv("SPEED")
- if speedEnv != "" {
- speed, err := strconv.ParseFloat(speedEnv, 64)
+ if speedStr != "" {
+ speed, err := strconv.ParseFloat(speedStr, 64)
if err != nil {
panic(err)
}