generateMML( $input ); $this->assertTrue( str_contains( $mathMLtexVC, "merror" ) ); } public function testSidesetSum() { $input = "\\sideset{_1^2}{_3^4}\\sum"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringNotContainsString( "merror", $mathMLtexVC ); $this->assertStringContainsString( "mmultiscripts", $mathMLtexVC ); $this->assertStringContainsString( "", $mathMLtexVC ); $this->assertStringContainsString( ">∑", $mathMLtexVC ); } public function testSidesetProd() { $input = "\\sideset{_1^2}{_3^4}\\prod"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringNotContainsString( "merror", $mathMLtexVC ); $this->assertStringContainsString( "mmultiscripts", $mathMLtexVC ); $this->assertStringContainsString( "", $mathMLtexVC ); $this->assertStringContainsString( ">∏", $mathMLtexVC ); } public function testSidesetFQ() { $input = "\\sideset{_1^2}{_3^4}\prod_a^b"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringNotContainsString( "merror", $mathMLtexVC ); $this->assertStringContainsString( "mmultiscripts", $mathMLtexVC ); $this->assertStringContainsString( "", $mathMLtexVC ); $this->assertStringContainsString( ">∏", $mathMLtexVC ); $this->assertStringContainsString( "a", $mathMLtexVC ); $this->assertStringContainsString( "b", $mathMLtexVC ); $this->assertStringContainsString( "movablelimits", $mathMLtexVC ); } public function testLimitsProd() { $input = "\\prod\\limits_{j=1}^k A_{\\alpha_j}"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( "munderover", $mathMLtexVC ); $this->assertStringContainsString( "∏", $mathMLtexVC, ); $this->assertStringContainsString( "msub", $mathMLtexVC, ); } public function testLimitsSum() { $input = "\\sum\\limits_{j=1}^k A_{\\alpha_j}"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( "munderover", $mathMLtexVC ); $this->assertStringContainsString( "∑", $mathMLtexVC, ); $this->assertStringContainsString( "msub", $mathMLtexVC, ); } public function testLimitsLim() { $input = "\\lim_{x \\to 2}"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( "lim", $mathMLtexVC ); $this->assertStringContainsString( "munder", $mathMLtexVC, ); } public function testRenderSpaceSemicolon() { $input = "{\\;}"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( "mstyle", $mathMLtexVC ); $this->assertStringContainsString( "mspace", $mathMLtexVC, ); } public function testSpacesAndCommas() { $input = "{a}{b , c}\\,"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( ",", $mathMLtexVC ); $this->assertStringContainsString( "mspace", $mathMLtexVC, ); } public function testPrecedingSubscriptsFQ() { $input = "{}_1^2\\!\\Omega_3^4"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( "", $mathMLtexVC ); $this->assertStringContainsString( "msubsup", $mathMLtexVC, ); } public function testPrecedingSubscriptsDQ() { $input = "{}_pF_q"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( "", $mathMLtexVC ); $this->assertStringContainsString( "msub", $mathMLtexVC, ); } public function testPilcrowAndSectionSign() { $input = "\\P P \\S S"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( "P", $mathMLtexVC ); $this->assertStringContainsString( "S", $mathMLtexVC, ); $this->assertStringContainsString( "¶", $mathMLtexVC, ); $this->assertStringContainsString( "§", $mathMLtexVC, ); } public function testDerivatives1() { $input = "b_{f''}"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( "″", $mathMLtexVC ); $this->assertStringContainsString( "msup", $mathMLtexVC, ); } public function testDerivatives2() { $input = "f''''(x)"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( "⁗", $mathMLtexVC ); $this->assertStringContainsString( "msup", $mathMLtexVC, ); } public function testLimitsTextstyle() { $input = "\\textstyle \\lim_{n \\to \\infty}x_n"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( "lim", $mathMLtexVC ); $this->assertStringContainsString( "munder", $mathMLtexVC, ); $this->assertStringContainsString( "movablelimits=\"true\"", $mathMLtexVC ); } public function testColorGeneration1() { $input = "\\color{Dandelion}{Dandelion}"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( "#FDBC42", $mathMLtexVC ); } public function testColorGeneration2() { $input = "\\color{ForestGreen}{ForestGreen}"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( "#009B55", $mathMLtexVC ); } public function testColorGeneration3() { $input = "\\color{Rhodamine}{Rhodamine}"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( "#EF559F", $mathMLtexVC ); } public function testStyle1() { $input = "\\displaystyle \{U(\omega )\cdot \sigma _{H}(\omega )\} z"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( "", $mathMLtexVC ); $this->assertStringContainsString( "z", $mathMLtexVC ); $this->assertStringContainsString( "", $mathMLtexVC, ); } public function testStyle2() { $input = "\\displaystyle abc \\textstyle def"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( "", $mathMLtexVC ); $this->assertStringContainsString( "", $mathMLtexVC, ); } public function testStyle3() { $input = "\\scriptstyle{abc} def \\textstyle ghi"; $mathMLtexVC = $this->generateMML( $input ); $this->assertStringContainsString( "", $mathMLtexVC ); $this->assertStringContainsString( "", $mathMLtexVC, ); } public function testStyle4() { $input = "\\textstyle b > \\textstyle \\delta"; $mathMLtexVC = $this->generateMML( $input ); $count = 0; str_replace( "assertEquals( 2, $count ); } private function generateMML( $input, $chem = false ) { $texVC = new TexVC(); $resultT = $texVC->check( $input, [ 'debug' => false, 'usemathrm' => false, 'oldtexvc' => false, 'usemhchem' => $chem ] ); return MMLTestUtil::getMMLwrapped( $resultT["input"] ) ?? " error texvc "; } }