Skip to content

Commit

Permalink
[#674] Clean up test case for introspective variant
Browse files Browse the repository at this point in the history
- remove vcsfake.VerifyLastCommandsAre() alternative approach
  • Loading branch information
mengdaming committed Oct 1, 2024
1 parent d7516c0 commit 72bd257
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
4 changes: 0 additions & 4 deletions src/engine/tcr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,6 @@ func Test_introspective_variant(t *testing.T) {

tcr.revert(*events.ATcrEvent())
assert.Equal(t, []fake.Command{fake.CommitCommand, fake.RevertCommand}, vcsFake.GetLastCommands(2))

//assert.True(t, vcsFake.VerifyLastCommandsAre(fake.CommitCommand, fake.RevertCommand),
// "got %v", vcsFake.GetLastCommands())

}

func Test_tcr_cycle_end_state(t *testing.T) {
Expand Down
7 changes: 0 additions & 7 deletions src/vcs/fake/vcs_test_fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ package fake

import (
"errors"
"github.com/google/go-cmp/cmp"
"github.com/murex/tcr/vcs"
)

Expand Down Expand Up @@ -116,12 +115,6 @@ func (vf *VCSFake) GetLastCommands(count int) []Command {
return vf.lastCommands[len(vf.lastCommands)-count:]
}

// VerifyLastCommandsAre checks if last executed commands are the provided ones
func (vf *VCSFake) VerifyLastCommandsAre(expectedCommands ...Command) bool {
actual := vf.lastCommands[len(vf.lastCommands)-len(expectedCommands):]
return cmp.Equal(actual, expectedCommands)
}

// Add does nothing. Returns an error if in the list of failing commands
func (vf *VCSFake) Add(_ ...string) error {
return vf.fakeCommand(AddCommand)
Expand Down

0 comments on commit 72bd257

Please sign in to comment.