mediawiki-extensions-AbuseF.../tests/parserTests/ip-in-range.t
Daimona Eaytoy 472d1221bd tests: Increase and rebalance code coverage
Also fix a couple of broken tests in Consequences:
 - For createaccount, $user->addToDatabase must be called before
   testForAccountCreation, or it will throw a CannotCreateActorException.
 - In testThrottleLimit, also set wgAbuseFilterEmergencyDisableThreshold
   to avoid relying on the local config.

Bug: T201193
Change-Id: If1a50b0a729e4d554485f2e2225d5877510966b6
2020-02-07 18:32:17 +00:00

5 lines
218 B
Perl

ip_in_range( '12.34.56.78', '12.34.56.0/24' ) &
ip_in_range( '12.34.56.78', '12.34.0.0/16' ) &
ip_in_range( '12.34.56.78', '12.0.0.0/8' ) &
ip_in_range( '1.1.1.1', '1.1.1.1/32' ) &
ip_in_range( '1.1.1.1', '0.0.0.0/0' )