Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9daea4a710 |
@@ -1704,8 +1704,7 @@ func TestGetASDetailsListsEachPrefixOnce(t *testing.T) {
|
||||
// record of, some with stored routes. Each gets the prefixes of its routes and
|
||||
// no seen times. One that the AS info lookup knows gets its handle and
|
||||
// description from it. An AS with no record, no lookup entry and no route is
|
||||
// ErrNoRoute. Before the fix an AS with no record got no prefixes, although
|
||||
// its routes were stored.
|
||||
// ErrNoRoute. Before the fix every AS with no record was ErrNoRoute.
|
||||
func TestGetASDetailsOfASNotInDatabase(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
@@ -1335,9 +1335,8 @@ func newServerWithStoredAS(t *testing.T) *Server {
|
||||
// All but unknownASN answer 200 with the handle and description from the
|
||||
// built-in AS list and their prefixes, as lists even when empty. Only storedASN
|
||||
// has a first_seen time. unknownASN answers 404. Before the fix builtInOnlyASN
|
||||
// answered 404, so a result of the AS name search could lead nowhere
|
||||
// (https://git.eeqj.de/sneak/routewatch/issues/151), and routeOnlyASN listed
|
||||
// no prefixes.
|
||||
// and routeOnlyASN answered 404 too
|
||||
// (https://git.eeqj.de/sneak/routewatch/issues/151).
|
||||
func TestASDetailJSONAnswersBuiltInAS(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -1427,9 +1426,8 @@ func TestASDetailJSONAnswersBuiltInAS(t *testing.T) {
|
||||
// list. storedASN and routeOnlyASN list their prefixes, and builtInOnlyASN says
|
||||
// the AS announces none. Only storedASN shows a first-seen date, and no page
|
||||
// shows a date that was never set. unknownASN answers 404. Before the fix
|
||||
// builtInOnlyASN answered 404, so a result of the AS name search led nowhere
|
||||
// (https://git.eeqj.de/sneak/routewatch/issues/151), and routeOnlyASN listed no
|
||||
// prefixes.
|
||||
// builtInOnlyASN and routeOnlyASN answered 404 too
|
||||
// (https://git.eeqj.de/sneak/routewatch/issues/151).
|
||||
func TestASDetailPageShowsBuiltInAS(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -1493,8 +1491,8 @@ func TestASDetailPageShowsBuiltInAS(t *testing.T) {
|
||||
// origin AS 0 (https://git.eeqj.de/sneak/routewatch/issues/75). It expects
|
||||
// /as/0 and /api/v1/as/0 to answer 404. It expects a search for "iana" to leave
|
||||
// AS 0 out of its results and its total, although the AS list built into
|
||||
// asinfo holds AS 0. Before the fix both AS answers were 200 and listed the
|
||||
// route's prefix, and the search listed AS 0 first.
|
||||
// asinfo holds AS 0. That search has more matches than an answer holds, so it
|
||||
// still lists maxASSearchResults of them.
|
||||
func TestNoOriginHasNoASAnswers(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -1546,6 +1544,11 @@ func TestNoOriginHasNoASAnswers(t *testing.T) {
|
||||
t.Errorf("the search for %q has a total of %d, want %d",
|
||||
query, data.Total, total-1)
|
||||
}
|
||||
|
||||
if len(data.Results) != maxASSearchResults {
|
||||
t.Errorf("the search for %q lists %d matches, want %d",
|
||||
query, len(data.Results), maxASSearchResults)
|
||||
}
|
||||
}
|
||||
|
||||
// settledGoroutineCount lets transient goroutines finish, then reports the
|
||||
|
||||
Reference in New Issue
Block a user