(t *testing.T)
| 38 | } |
| 39 | |
| 40 | func TestDomainRegexp(t *testing.T) { |
| 41 | hostcases := []regexpMatch{ |
| 42 | { |
| 43 | input: "test.com", |
| 44 | match: true, |
| 45 | }, |
| 46 | { |
| 47 | input: "test.com:10304", |
| 48 | match: true, |
| 49 | }, |
| 50 | { |
| 51 | input: "test.com:http", |
| 52 | match: false, |
| 53 | }, |
| 54 | { |
| 55 | input: "localhost", |
| 56 | match: true, |
| 57 | }, |
| 58 | { |
| 59 | input: "localhost:8080", |
| 60 | match: true, |
| 61 | }, |
| 62 | { |
| 63 | input: "a", |
| 64 | match: true, |
| 65 | }, |
| 66 | { |
| 67 | input: "a.b", |
| 68 | match: true, |
| 69 | }, |
| 70 | { |
| 71 | input: "ab.cd.com", |
| 72 | match: true, |
| 73 | }, |
| 74 | { |
| 75 | input: "a-b.com", |
| 76 | match: true, |
| 77 | }, |
| 78 | { |
| 79 | input: "-ab.com", |
| 80 | match: false, |
| 81 | }, |
| 82 | { |
| 83 | input: "ab-.com", |
| 84 | match: false, |
| 85 | }, |
| 86 | { |
| 87 | input: "ab.c-om", |
| 88 | match: true, |
| 89 | }, |
| 90 | { |
| 91 | input: "ab.-com", |
| 92 | match: false, |
| 93 | }, |
| 94 | { |
| 95 | input: "ab.com-", |
| 96 | match: false, |
| 97 | }, |
nothing calls this directly
no test coverage detected
searching dependent graphs…