r76872 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76871‎ | r76872 | r76873 >
Date:01:02, 17 November 2010
Author:aaron
Status:ok
Tags:
Comment:
Added two key ipv6 tests
Modified paths:
  • /trunk/phase3/maintenance/tests/phpunit/includes/IPTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/phpunit/includes/IPTest.php
@@ -17,6 +17,7 @@
1818 $this->assertFalse( IP::isIPAddress( '124.24.52' ), 'IPv4 not enough quads' );
1919 $this->assertFalse( IP::isIPAddress( '24.324.52.13' ), 'IPv4 out of range' );
2020 $this->assertFalse( IP::isIPAddress( '.24.52.13' ), 'IPv4 starts with period' );
 21+ $this->assertFalse( IP::isIPAddress( 'fc:100:300' ), 'IPv6 with only 3 words' );
2122
2223 $this->assertTrue( IP::isIPAddress( '::' ), 'RFC 4291 IPv6 Unspecified Address' );
2324 $this->assertTrue( IP::isIPAddress( '::1' ), 'RFC 4291 IPv6 Loopback Address' );
@@ -34,6 +35,7 @@
3536 public function testisIPv6() {
3637 $this->assertFalse( IP::isIPv6( ':fc:100::' ), 'IPv6 starting with lone ":"' );
3738 $this->assertFalse( IP::isIPv6( 'fc:100:::' ), 'IPv6 ending with a ":::"' );
 39+ $this->assertFalse( IP::isIPv6( 'fc:100:300' ), 'IPv6 with only 3 words' );
3840 $this->assertTrue( IP::isIPv6( 'fc:100::' ) );
3941 $this->assertTrue( IP::isIPv6( 'fc:100:a::' ) );
4042 $this->assertTrue( IP::isIPv6( 'fc:100:a:d::' ) );

Status & tagging log