github.com/sdboyer/gps@v0.16.3/internal/internal_test.go (about)

     1  package internal
     2  
     3  import "testing"
     4  
     5  func TestIsStdLib(t *testing.T) {
     6  	fix := []struct {
     7  		ip string
     8  		is bool
     9  	}{
    10  		{"appengine", true},
    11  		{"net/http", true},
    12  		{"github.com/anything", false},
    13  		{"foo", true},
    14  	}
    15  
    16  	for _, f := range fix {
    17  		r := doIsStdLib(f.ip)
    18  		if r != f.is {
    19  			if r {
    20  				t.Errorf("%s was marked stdlib but should not have been", f.ip)
    21  			} else {
    22  				t.Errorf("%s was not marked stdlib but should have been", f.ip)
    23  
    24  			}
    25  		}
    26  	}
    27  }
    28