| 1686 | } |
| 1687 | |
| 1688 | func compareChecks(got, want map[CheckKey]*check) []error { |
| 1689 | errs := make([]error, 0) |
| 1690 | if len(got) != len(want) { |
| 1691 | errs = append(errs, fmt.Errorf("Got %d checks, want %d", len(got), len(want))) |
| 1692 | return errs |
| 1693 | } |
| 1694 | for k := range want { |
| 1695 | if _, ok := got[k]; !ok { |
| 1696 | errs = append(errs, fmt.Errorf("Expected check %v, not found", k)) |
| 1697 | continue |
| 1698 | } |
| 1699 | if *got[k].healthcheck != *want[k].healthcheck { |
| 1700 | errs = append(errs, fmt.Errorf("Got check %#+v, want %#+v", *got[k].healthcheck, *want[k].healthcheck)) |
| 1701 | } |
| 1702 | } |
| 1703 | return errs |
| 1704 | } |
| 1705 | |
| 1706 | func compareServiceStates(want []*service, got map[serviceKey]*service) []error { |
| 1707 | var errs []error |