ooni-probe-cli/internal/netxlite/bogon_test.go
Simone Basso f91de2ecd6
cleanup: move bogon checking code in netxlite (#562)
I develop this diff while working on https://github.com/ooni/probe/issues/1803#issuecomment-957323297.

While there, make sure we don't have duplicate bogon code
and always use the code inside netxlite.
2021-11-02 12:20:04 +01:00

19 lines
342 B
Go

package netxlite
import "testing"
func TestIsBogon(t *testing.T) {
if IsBogon("antani") != true {
t.Fatal("unexpected result")
}
if IsBogon("127.0.0.1") != true {
t.Fatal("unexpected result")
}
if IsBogon("1.1.1.1") != false {
t.Fatal("unexpected result")
}
if IsBogon("10.0.1.1") != true {
t.Fatal("unexpected result")
}
}