golang.org/x/build@v0.0.0-20240506185731-218518f32b70/internal/gophers/gophers_test.go (about)

     1  // Copyright 2019 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package gophers_test
     6  
     7  import (
     8  	"testing"
     9  
    10  	"golang.org/x/build/internal/gophers"
    11  )
    12  
    13  func TestPersonName(t *testing.T) {
    14  	for _, tt := range []struct {
    15  		id   string
    16  		want string
    17  	}{
    18  		{id: "@golang/tools-team", want: "Tools Team"},
    19  	} {
    20  		p := gophers.GetPerson(tt.id)
    21  		if p == nil {
    22  			t.Errorf("no person with id %q", tt.id)
    23  			continue
    24  		}
    25  		got := p.Name
    26  		if got != tt.want {
    27  			t.Errorf("person with id %q now has name %q but used to have %q; is that change intentional?", tt.id, got, tt.want)
    28  		}
    29  	}
    30  }
    31  
    32  // Test that a few people whose Gerrit emails have been broken
    33  // in the past still have the expected Gerrit email. This test
    34  // is mostly needed until golang.org/issue/34259 is resolved.
    35  func TestGerritEmail(t *testing.T) {
    36  	for _, tt := range []struct {
    37  		id   string
    38  		want string
    39  	}{
    40  		{id: "Andrew Bonventre", want: "andybons@golang.org"},
    41  		{id: "Carl Mastrangelo", want: "notcarl@google.com"},
    42  		{id: "Chris McGee", want: "newton688@gmail.com"},
    43  		{id: "Eric Lagergren", want: "ericscottlagergren@gmail.com"},
    44  		{id: "Filippo Valsorda", want: "filippo@golang.org"},
    45  		{id: "Guillaume J. Charmes", want: "guillaume@charmes.net"},
    46  		{id: "Harshavardhana", want: "hrshvardhana@gmail.com"},
    47  		{id: "Jean de Klerk", want: "deklerk@google.com"},
    48  		{id: "Joe Tsai", want: "joetsai@digital-static.net"},
    49  		{id: "Martin Möhrmann", want: "moehrmann@google.com"},
    50  		{id: "Matthew Dempsky", want: "mdempsky@google.com"},
    51  		{id: "Olivier Poitrey", want: "rs@netflix.com"},
    52  		{id: "Paul Jolly", want: "paul@myitcv.org.uk"},
    53  		{id: "Ralph Corderoy", want: "ralph@inputplus.co.uk"},
    54  		{id: "Raul Silvera", want: "rsilvera@google.com"},
    55  		{id: "Richard Miller", want: "millerresearch@gmail.com"},
    56  		{id: "Sebastien Binet", want: "seb.binet@gmail.com"},
    57  		{id: "Tobias Klauser", want: "tobias.klauser@gmail.com"},
    58  		{id: "Vitor De Mario", want: "vitordemario@gmail.com"},
    59  
    60  		// We're still figuring out how to handle teams.
    61  		// At this time their Gerrit email is unset.
    62  		{id: "Fuzzing Team", want: ""},
    63  		{id: "Pkgsite Team", want: ""},
    64  		{id: "Tools Team", want: ""},
    65  	} {
    66  		p := gophers.GetPerson(tt.id)
    67  		if p == nil {
    68  			t.Errorf("no person with id %q", tt.id)
    69  			continue
    70  		}
    71  		got := p.Gerrit
    72  		if got != tt.want {
    73  			t.Errorf("person with id %q now has Gerrit email %q but used to have %q; is that change intentional?", tt.id, got, tt.want)
    74  		}
    75  	}
    76  }