mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-11 16:58:38 +00:00
Extend BaseParsing test coverage
Change-Id: I4e8ff663e1516bcdeb6133bb12391ad48b056367
This commit is contained in:
parent
1befc6373d
commit
c0ac8ee0e7
|
@ -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