(t *testing.T)
| 236 | } |
| 237 | |
| 238 | func TestRightPad(t *testing.T) { |
| 239 | for _, c := range []struct { |
| 240 | pad int |
| 241 | in string |
| 242 | expect string |
| 243 | }{ |
| 244 | {0, "", ""}, |
| 245 | {4, "", " "}, |
| 246 | {4, "x", "x "}, |
| 247 | {4, "abcd", "abcd"}, // No padding because of overflow |
| 248 | {4, "abcde", "abcde"}, // No padding because of overflow |
| 249 | {10, "\tx", " x "}, |
| 250 | {10, "w\txy\tz", "w xy z"}, |
| 251 | {20, "w\txy\tz", "w xy z "}, |
| 252 | } { |
| 253 | out := rightPad(c.in, c.pad) |
| 254 | if out != c.expect { |
| 255 | t.Errorf("rightPad(%q, %d): got %q, want %q", c.in, c.pad, out, c.expect) |
| 256 | } |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | func readProfile(fname string, t *testing.T) *profile.Profile { |
| 261 | file, err := os.Open(fname) |
nothing calls this directly
no test coverage detected
searching dependent graphs…