Download this file
| 1 | package fixture |
| 2 | |
| 3 | // Not compiled: testdata is ignored by the go tool. |
| 4 | |
| 5 | import "strings" |
| 6 | |
| 7 | // render is a helper the gate does not read. A correct join elsewhere in |
| 8 | // this file must not answer for it. |
| 9 | func render(names []string) string { return strings.Join(names, ", ") } |
| 10 | |
| 11 | // MV-N1 |
| 12 | func differs(names []string) string { |
| 13 | return "the environment differs from the source's: " + render(names) |
| 14 | } |
| 15 | |
| 16 | // MV-N2: nothing calls it. |
| 17 | func storeDiffers(list string) string { |
| 18 | return "the store differs from the source's: " + list |
| 19 | } |
| 20 | |
| 21 | // MV-N3: one caller, through a local variable. |
| 22 | func zoneLine(list string) string { return "the zones that answered: " + list } |
| 23 | |
| 24 | func zones(zs []string) string { |
| 25 | joined := strings.Join(zs, ", ") |
| 26 | return zoneLine(joined) |
| 27 | } |
| 28 | |
| 29 | // MV-N4: two callers; the second joins with " or ". |
| 30 | func regionLine(list string) string { return "the regions that answered: " + list } |
| 31 | |
| 32 | func regions(rs []string) string { return regionLine(strings.Join(rs, ", ")) } |
| 33 | |
| 34 | func regionsOr(rs []string) string { return regionLine(strings.Join(rs, " or ")) } |
| 35 | |