Includes a few minor fixes: - frontend: support setting port for WHOIS server - proxy: fix handling of very long lines - proxy: refactor IP allowlist logic, parse allow IP list at startup
26 lines
475 B
Go
26 lines
475 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/magiconair/properties/assert"
|
|
)
|
|
|
|
func TestSummaryRowDataNameHasPrefix(t *testing.T) {
|
|
data := SummaryRowData{
|
|
Name: "mock",
|
|
}
|
|
|
|
assert.Equal(t, data.NameHasPrefix("m"), true)
|
|
assert.Equal(t, data.NameHasPrefix("n"), false)
|
|
}
|
|
|
|
func TestSummaryRowDataNameContains(t *testing.T) {
|
|
data := SummaryRowData{
|
|
Name: "mock",
|
|
}
|
|
|
|
assert.Equal(t, data.NameContains("oc"), true)
|
|
assert.Equal(t, data.NameContains("no"), false)
|
|
}
|