package api
import "testing"
// #366: a merge whose every run was cancelled (or errored) has no
// verdict, and says so; one run still going or done is not that.
func TestAllCancelledIsAMergeNobodyJudged(t *testing.T) {
if allCancelled(nil) {
t.Error("FAIL: no runs read as all cancelled")
}
if !allCancelled([]CIRun{{Status: "cancelled"}, {Status: "error"}}) {
t.Error("FAIL: cancelled and errored runs are not all cancelled")
}
if allCancelled([]CIRun{{Status: "cancelled"}, {Status: "completed"}}) {
t.Error("FAIL: a completed run among cancelled ones read as all cancelled")
}
}