Page MenuHomeWickedGov Phorge

IntentEvalTest.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

IntentEvalTest.php

<?php
namespace MediaWiki\Extension\Math\WikiTexVC\Intent;
use MediaWiki\Extension\Math\WikiTexVC\TexVC;
use MediaWikiUnitTestCase;
/**
* Test for intent validation functions and checking basic usage of the experimental
* intent annotation feature.
*
* @covers \MediaWiki\Extension\Math\WikiTexVC\TexVC
*/
final class IntentEvalTest extends MediaWikiUnitTestCase {
public function testTwoArgumentApplication() {
$input = "first-derivative(\$a)(\$b)";
$texvc = new TexVC();
$ret = $texvc->checkIntent( $input );
$this->assertTrue( $ret );
}
public function testIntentShouldFailIfNotActive() {
$texVC = new TexVC();
$resultT = $texVC->check( "\\intent{\\binom{n}{k}}{intent='binomial(\$n,\$k)'}", [
"useintent" => false,
] );
$this->assertEquals( "C", $resultT["status"] );
$this->assertStringContainsString( "virtual intent package required", $resultT["details"] );
}
public function testIntentFailure() {
$texVC = new TexVC();
$resultT = $texVC->check( "\\intent{\\binom{n}{k}}{intent='bino?mial(\$n,\$k)'}", [
'useintent' => true,
] );
$this->assertEquals( 'S', $resultT['status' ] );
}
public function testIntentFailure2() {
$texVC = new TexVC();
$resultT = $texVC->check( "\\intent{\\binom{n}{k}}{intent='binomial(\$n,\$k)',arg='n,k'}", [
'useintent' => true,
] );
$this->assertEquals( 'I', $resultT['status' ] );
$this->assertEquals( 'intent check failed.', $resultT['details' ] );
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Nov 22, 18:50 (1 d, 9 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
78/10/3dd304530ec249e60c138ada2afb
Default Alt Text
IntentEvalTest.php (1 KB)

Event Timeline