Skip to content

Commit

Permalink
Changed TestFromMap_Success test to make it behave the same regardles…
Browse files Browse the repository at this point in the history
…s the OS
  • Loading branch information
n0rdy committed Nov 18, 2023
1 parent 36227cb commit ea07d6b
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions pipeline/pipeline_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package pipeline

import (
"github.com/n0rdy/pippin/types"
"github.com/n0rdy/pippin/types/statuses"
"testing"
)
Expand Down Expand Up @@ -45,14 +44,20 @@ func TestFromMap_Success(t *testing.T) {
t.Errorf("Expected status %s, got %s", statuses.Status(statuses.Running).String(), p.Status.String())
}

for k, v := range m {
eFromChan := <-p.InitStage.Chan
if eFromChan.First != k || eFromChan.Second != v {
t.Errorf("Expected element %d, got %d", types.Tuple[int, int]{
First: k,
Second: v,
}, eFromChan)
i := 0
for eFromChan := range p.InitStage.Chan {
if v, ok := m[eFromChan.First]; ok {
if v != eFromChan.Second {
t.Errorf("Expected element %d, got %d", v, eFromChan)
}
} else {
t.Errorf("Expected element %d, got %d", v, eFromChan)
}
i++
}

if i != len(m) {
t.Errorf("Expected %d elements, got %d", len(m), i)
}

if p.rateLimiter != nil {
Expand Down

0 comments on commit ea07d6b

Please sign in to comment.