Skip to content

Commit

Permalink
Merge pull request #270 from Eclalang/issue-#269-add-test-in-bus
Browse files Browse the repository at this point in the history
update bus_test for 100% coverage
  • Loading branch information
tot0p authored Feb 26, 2024
2 parents 3208d06 + 7d20812 commit 020c265
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions interpreter/bus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,20 @@ func TestNewNoneBus(t *testing.T) {
t.Errorf("Expected %s, got %d", "BUS_NONE", t1.Type)
}
}

func TestIsMultipleBus(t *testing.T) {
var allBus []*Bus
t1 := NewNoneBus()
allBus = append(allBus, t1)

if IsMultipleBus(allBus) {
t.Errorf("Expected %s, got %s", "false", "true")
}

t2 := NewMainBus(nil)
allBus = append(allBus, t2)

if !IsMultipleBus(allBus) {
t.Errorf("Expected %s, got %s", "true", "false")
}
}

0 comments on commit 020c265

Please sign in to comment.