(expected string)
| 134 | } |
| 135 | |
| 136 | func verify(expected string) error { |
| 137 | cmd := be.Command("show") |
| 138 | out, err := cmd.Output() |
| 139 | if err != nil { |
| 140 | return err |
| 141 | } |
| 142 | actual := string(out) |
| 143 | log.Debugf("Command %v output %v", cmd.Path, actual) |
| 144 | if !allEquals(expected, actual) { |
| 145 | return fmt.Errorf("unexpected output: expect '%s', got '%s'", expected, actual) |
| 146 | } |
| 147 | return nil |
| 148 | } |
| 149 | |
| 150 | func allEquals(expected string, actual string) bool { |
| 151 | if (expected == "") != (strings.TrimSpace(actual) == "") { // XOR |
no test coverage detected
searching dependent graphs…