Skip to content

Commit

Permalink
Merge pull request #241 from brotherlogic/ignore
Browse files Browse the repository at this point in the history
ignore
  • Loading branch information
brotherlogic committed Apr 8, 2020
2 parents e4de2cf + db8d044 commit 69a008b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions recordprinterutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ func (s *Server) move(ctx context.Context, move *pbrm.RecordMove) error {
}
}

// Don't show after context for sales
if move.GetAfterContext().GetLocation() == "Sell" {
surrounds = nil
}

if surrounds != nil {
lines = append(lines, fmt.Sprintf("Slot %v", surrounds.GetSlot()))
if surrounds.GetBeforeInstance() != 0 {
Expand Down
8 changes: 8 additions & 0 deletions recordprinterutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,14 @@ func TestListeningPileMove(t *testing.T) {
}
}

func TestSekkMove(t *testing.T) {
s := InitTestServer()
res := s.move(context.Background(), &pbrm.RecordMove{BeforeContext: &pbrm.Context{Location: "same"}, AfterContext: &pbrm.Context{Location: "Sell"}})
if res != nil {
t.Errorf("Bad move")
}
}

func TestLocationMoveDiffTo(t *testing.T) {
s := InitTestServer()
s.move(context.Background(), &pbrm.RecordMove{ToFolder: 1, FromFolder: 2, BeforeContext: &pbrm.Context{Location: "same"}, AfterContext: &pbrm.Context{Location: "same"}})
Expand Down

0 comments on commit 69a008b

Please sign in to comment.