mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-23 23:25:02 +00:00
Merge "Extend BaseParsing test coverage"
This commit is contained in:
commit
3144795c42
|
@ -6,6 +6,8 @@ use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\BaseParsing;
|
|||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\DQ;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun1;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Literal;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Matrix;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\TexArray;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
|
@ -32,6 +34,33 @@ class BaseParsingTest extends TestCase {
|
|||
$this->assertStringContainsString( '<mi k="v"', $result );
|
||||
}
|
||||
|
||||
public function testArray() {
|
||||
$node = new Matrix( 'matrix',
|
||||
new TexArray( new TexArray( new Literal( 'a' ) ) ) );
|
||||
|
||||
$result = BaseParsing::array( $node, [], null, 'array', '007E' );
|
||||
$this->assertStringContainsString( '<mi>a</mi>', $result );
|
||||
}
|
||||
|
||||
public function testBoldSymbol() {
|
||||
$node = new Fun1(
|
||||
'\\boldsymbol',
|
||||
( new Literal( 'a' ) )
|
||||
);
|
||||
$result = BaseParsing::boldsymbol( $node, [], null, 'boldsymbol' );
|
||||
$this->assertStringContainsString( 'mathvariant="bold-italic"', $result );
|
||||
}
|
||||
|
||||
public function testCancel() {
|
||||
$node = new Fun1(
|
||||
'\\cancel',
|
||||
( new Literal( 'a' ) )
|
||||
);
|
||||
$result = BaseParsing::cancel( $node, [], null, 'cancel', 'something' );
|
||||
$this->assertStringContainsString( '<menclose notation="something"><mi>a</mi></menclose>',
|
||||
$result );
|
||||
}
|
||||
|
||||
public function testUnderOver() {
|
||||
$node = new Fun1(
|
||||
'\\overline',
|
||||
|
|
Loading…
Reference in a new issue