| // Copyright 2017 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| "golang.org/x/build/maintner/maintpb" |
| type mutationTest struct { |
| func (mt mutationTest) test(t *testing.T, muts ...*maintpb.Mutation) { |
| c.processMutationLocked(m) |
| if !reflect.DeepEqual(c, mt.want) { |
| t.Errorf("corpus mismatch\n got: %#v\nwant: %#v", c, mt.want) |
| func TestProcessMutation_Github_NewIssue(t *testing.T) { |
| githubUsers: map[int64]*githubUser{ |
| githubIssues: map[githubRepo]map[int32]*githubIssue{ |
| "golang/go": map[int32]*githubIssue{ |
| User: &githubUser{ID: 100, Login: "gopherbot"}, |
| }.test(t, &maintpb.Mutation{ |
| GithubIssue: &maintpb.GithubIssueMutation{ |
| User: &maintpb.GithubUser{ |