Skip to content

Commit

Permalink
Some lintian fixes to tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
sil2100 committed Nov 17, 2023
1 parent 85112cd commit dab970c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/statemachine/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1388,14 +1388,14 @@ func TestStateMachine_updateGrub_checkcmds(t *testing.T) {
execCommand = mockCmder.Command
t.Cleanup(func() { execCommand = exec.Command })

stdout, restoreStdout, err := helper.CaptureStd(&os.Stdout)
stdout, restoreStdout, _ := helper.CaptureStd(&os.Stdout)
t.Cleanup(func() { restoreStdout() })

err = stateMachine.updateGrub("", 2)
asserter.AssertErrNil(err, true)

restoreStdout()
readStdout, err := io.ReadAll(stdout)
readStdout, _ := io.ReadAll(stdout)

expectedCmds := []*regexp.Regexp{
regexp.MustCompile("mount .*p2 .*/scratch/loopback"),
Expand All @@ -1417,7 +1417,7 @@ func TestStateMachine_updateGrub_checkcmds(t *testing.T) {

gotCmds := strings.Split(strings.TrimSpace(string(readStdout)), "\n")
if len(expectedCmds) != len(gotCmds) {
t.Fatalf("%v commands to be executed, expected %v", len(gotCmds), len(expectedCmds))
a t.Fatalf("%v commands to be executed, expected %v", len(gotCmds), len(expectedCmds))

Check failure on line 1420 in internal/statemachine/helper_test.go

View workflow job for this annotation

GitHub Actions / check_quality

expected ';', found t
}

for i, gotCmd := range gotCmds {
Expand Down

0 comments on commit dab970c

Please sign in to comment.