Bug 23715: replaced 8-megabyte txt file that crashed many text editors with one str_r...
authorMax Semenik <maxsem@users.mediawiki.org>
Sun, 30 May 2010 17:41:53 +0000 (17:41 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Sun, 30 May 2010 17:41:53 +0000 (17:41 +0000)
maintenance/ExtraParserTests.txt
maintenance/tests/ExtraParserTest.php [new file with mode: 0644]

index f0742f7..66b8032 100644 (file)
Binary files a/maintenance/ExtraParserTests.txt and b/maintenance/ExtraParserTests.txt differ
diff --git a/maintenance/tests/ExtraParserTest.php b/maintenance/tests/ExtraParserTest.php
new file mode 100644 (file)
index 0000000..15a692d
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Parser-related tests that don't suit for parserTests.txt
+ */
+ class ExtraParserTest extends PHPUnit_Framework_TestCase {
+
+       // Bug 8689 - Long numeric lines kill the parser
+       function testBug8689() {
+               $longLine = '1.' . str_repeat( '1234567890', 100000 ) . "\n";
+
+               $parser = new Parser();
+               $t = Title::newFromText( 'Unit test' );
+               $options = new ParserOptions();
+               $this->assertEquals( "<p>$longLine</p>", 
+                       $parser->parse( $longLine, $t, $options )->getText() );
+       }
+ }
\ No newline at end of file