2014-07-10 19:21:58 +00:00
|
|
|
<?php
|
|
|
|
|
2022-07-30 22:43:58 +00:00
|
|
|
namespace MediaWiki\Extension\Scribunto\Tests\Engines\LuaCommon;
|
|
|
|
|
2018-05-27 00:50:43 +00:00
|
|
|
/**
|
|
|
|
* @coversNothing -- Covers Lua code
|
|
|
|
*/
|
2022-08-03 12:31:15 +00:00
|
|
|
class UstringLibraryPureLuaTest extends UstringLibraryTest {
|
2021-07-23 10:49:13 +00:00
|
|
|
protected function setUp(): void {
|
2014-07-10 19:21:58 +00:00
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
// Override mw.ustring with the pure-Lua version
|
|
|
|
$interpreter = $this->getEngine()->getInterpreter();
|
|
|
|
$interpreter->callFunction(
|
|
|
|
$interpreter->loadString( '
|
|
|
|
local ustring = require( "ustring" )
|
|
|
|
ustring.maxStringLength = mw.ustring.maxStringLength
|
|
|
|
ustring.maxPatternLength = mw.ustring.maxPatternLength
|
|
|
|
mw.ustring = ustring
|
|
|
|
', 'fortest' )
|
|
|
|
);
|
|
|
|
}
|
2016-03-24 14:08:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providePCREErrors
|
|
|
|
*/
|
|
|
|
public function testPCREErrors( $ini, $args, $error ) {
|
|
|
|
// Not applicable
|
|
|
|
$this->assertTrue( true );
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function providePCREErrors() {
|
2017-06-15 17:19:00 +00:00
|
|
|
return [
|
|
|
|
[ [], [], null ],
|
|
|
|
];
|
2016-03-24 14:08:29 +00:00
|
|
|
}
|
2014-07-10 19:21:58 +00:00
|
|
|
}
|