How to use this.execute method in Appium Xcuitest Driver

Best JavaScript code snippet using appium-xcuitest-driver

math_semantic_tree_test.js

Source:math_semantic_tree_test.js Github

copy

Full Screen

1// Copyright 2014 The Chromium Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.4// Include test fixture.5GEN_INCLUDE(['../testing/chromevox_unittest_base.js']);6/**7 * Test fixture.8 * @constructor9 * @extends {ChromeVoxUnitTestBase}10 */11function CvoxSemanticTreeUnitTest() {}12CvoxSemanticTreeUnitTest.prototype = {13 __proto__: ChromeVoxUnitTestBase.prototype,14 /** @override */15 closureModuleDeps: [16 'cvox.SemanticAttr',17 'cvox.SemanticTree',18 'cvox.SemanticUtil',19 'cvox.XpathUtil'20 ],21 /** @override */22 setUp: function() {23 this.nodeCounter = 0;24 this.xpathBlacklist = [];25 this.brief = true;26 this.setupAttributes();27 },28 /**29 * Adds some unicode characters via hex code to the right category.30 *31 * This method is necessary as the test framework can not handle code32 * containing utf-8 encoded characters.33 */34 setupAttributes: function() {35 var attr = cvox.SemanticAttr.getInstance();36 attr.neutralFences.unshift(cvox.SemanticUtil.numberToUnicode(0x00A6));37 attr.dashes.unshift(cvox.SemanticUtil.numberToUnicode(0x2015));38 attr.neutralFences.unshift(cvox.SemanticUtil.numberToUnicode(0x2016));39 attr.arrows.unshift(cvox.SemanticUtil.numberToUnicode(0x2192));40 attr.sumOps.unshift(cvox.SemanticUtil.numberToUnicode(0x2211));41 attr.additions.unshift(cvox.SemanticUtil.numberToUnicode(0x2213));42 attr.multiplications.unshift(cvox.SemanticUtil.numberToUnicode(0x2218));43 attr.intOps.unshift(cvox.SemanticUtil.numberToUnicode(0x222B));44 attr.inequalities.unshift(cvox.SemanticUtil.numberToUnicode(0x2264));45 attr.additions.unshift(cvox.SemanticUtil.numberToUnicode(0x2295));46 var open = cvox.SemanticUtil.numberToUnicode(0x3008);47 var close = cvox.SemanticUtil.numberToUnicode(0x3009);48 attr.openClosePairs[open] = close;49 attr.leftFences.unshift(open);50 attr.rightFences.unshift(close);51 },52 /**53 * Removes XML nodes according to the XPath elements in the blacklist.54 * @param {Node} xml Xml representation of the semantic node.55 */56 customizeXml: function(xml) {57 this.xpathBlacklist.forEach(58 function(xpath) {59 var removes = cvox.XpathUtil.evalXPath(xpath, xml);60 removes.forEach(61 function(node) {62 node.parentNode.removeChild(node);63 });64 });65 },66 /**67 * Tests if for a given mathml snippet results in a particular semantic tree.68 * @param {string} mml MathML expression.69 * @param {string} sml XML snippet for the semantic tree.70 */71 executeTreeTest: function(mml, sml) {72 var mathMl = '<math id=' + this.nodeCounter + '>' + mml + '';73 this.loadHtml(mathMl);74 var node = document.getElementById((this.nodeCounter++).toString());75 var stree = new cvox.SemanticTree(/** @type {!Element} */(node));76 var sxml = stree.xml(this.brief);77 this.customizeXml(sxml);78 var dp = new DOMParser();79 var xml = dp.parseFromString('<stree>' + sml + '</stree>', 'text/xml');80 var xmls = new XMLSerializer();81 assertEquals(xmls.serializeToString(xml),82 xmls.serializeToString(sxml));83 }84};85TEST_F('CvoxSemanticTreeUnitTest', 'StreeRelations', function() {86 this.brief = true;87 this.executeTreeTest(88 '<mo>=</mo>',89 '<relation>=</relation>');90 this.executeTreeTest(91 '<mi>a</mi><mo>=</mo><mi>b</mi>',92 '<relseq>=' +93 '<content><relation>=</relation></content>' +94 '<children>' +95 '<identifier>a</identifier>' +96 '<identifier>b</identifier>' +97 '</children>' +98 '</relseq>');99 this.executeTreeTest(100 '<mi>a</mi><mo>=</mo><mi>b</mi><mo>=</mo><mi>c</mi>',101 '<relseq>=' +102 '<content><relation>=</relation><relation>=</relation></content>' +103 '<children>' +104 '<identifier>a</identifier>' +105 '<identifier>b</identifier>' +106 '<identifier>c</identifier>' +107 '</children>' +108 '</relseq>');109 this.executeTreeTest(110 '<mi>a</mi><mo>=</mo><mi>b</mi><mo>=</mo><mi>c</mi>' +111 '<mo>\u2264</mo><mi>d</mi>',112 '<multirel>' +113 '<content><relation>=</relation><relation>=</relation>' +114 '<relation>\u2264</relation></content>' +115 '<children>' +116 '<identifier>a</identifier>' +117 '<identifier>b</identifier>' +118 '<identifier>c</identifier>' +119 '<identifier>d</identifier>' +120 '</children>' +121 '</multirel>');122});123// Operators.124/**125 * Test operator trees with pre- and postfixes.126 */127TEST_F('CvoxSemanticTreeUnitTest', 'StreePrePostfixOperators', function() {128 this.brief = true;129 // Pathological operator only case.130 this.executeTreeTest(131 '<mo>+</mo><mo>-</mo><mo>+</mo>',132 '<prefixop>+' +133 '<content><operator>+</operator></content>' +134 '<children>' +135 '<prefixop>-' +136 '<content><operator>-</operator></content>' +137 '<children>' +138 '<operator>+</operator>' +139 '</children>' +140 '</prefixop>' +141 '</children>' +142 '</prefixop>');143 // Single identifier with prefixes.144 this.executeTreeTest(145 '<mo>+</mo><mo>+</mo><mi>a</mi>',146 '<prefixop>+ +' +147 '<content><operator>+</operator><operator>+</operator></content>' +148 '<children>' +149 '<identifier>a</identifier>' +150 '</children>' +151 '</prefixop>');152 // Single identifier with prefix and negative.153 this.executeTreeTest(154 '<mo>+</mo><mo>-</mo><mi>a</mi>',155 '<prefixop>+' +156 '<content><operator>+</operator></content>' +157 '<children>' +158 '<prefixop>-' +159 '<content><operator>-</operator></content>' +160 '<children>' +161 '<identifier>a</identifier>' +162 '</children>' +163 '</prefixop>' +164 '</children>' +165 '</prefixop>');166 // Single identifier with postfixes.167 this.executeTreeTest(168 '<mi>a</mi><mo>+</mo><mo>-</mo>',169 '<postfixop>+ -' +170 '<content><operator>+</operator><operator>-</operator></content>' +171 '<children>' +172 '<identifier>a</identifier>' +173 '</children>' +174 '</postfixop>');175 // Single identifier with pre- and postfixes.176 this.executeTreeTest(177 '<mo>+</mo><mo>+</mo><mi>a</mi><mo>+</mo><mo>+</mo>',178 '<postfixop>+ +' +179 '<content><operator>+</operator><operator>+</operator></content>' +180 '<children>' +181 '<prefixop>+ +' +182 '<content><operator>+</operator><operator>+</operator></content>' +183 '<children>' +184 '<identifier>a</identifier>' +185 '</children>' +186 '</prefixop>' +187 '</children>' +188 '</postfixop>');189 // Single identifier with mixed pre- and postfixes.190 this.executeTreeTest(191 '<mo>\u2213</mo><mo>+</mo><mi>a</mi><mo>\u2213</mo><mo>+</mo>',192 '<postfixop>\u2213 +' +193 '<content>' +194 '<operator>\u2213</operator><operator>+</operator>' +195 '</content>' +196 '<children>' +197 '<prefixop>\u2213 +' +198 '<content>' +199 '<operator>\u2213</operator><operator>+</operator>' +200 '</content>' +201 '<children>' +202 '<identifier>a</identifier>' +203 '</children>' +204 '</prefixop>' +205 '</children>' +206 '</postfixop>');207 // Two identifiers with pre- and postfixes.208 this.executeTreeTest(209 '<mo>+</mo><mo>+</mo><mi>a</mi><mo>\u2213</mo><mo>+</mo>' +210 '<mi>b</mi><mo>+</mo>',211 '<infixop>\u2213' +212 '<content><operator>\u2213</operator></content>' +213 '<children>' +214 '<prefixop>+ +' +215 '<content><operator>+</operator><operator>+</operator></content>' +216 '<children>' +217 '<identifier>a</identifier>' +218 '</children>' +219 '</prefixop>' +220 '<postfixop>+' +221 '<content><operator>+</operator></content>' +222 '<children>' +223 '<prefixop>+' +224 '<content><operator>+</operator></content>' +225 '<children>' +226 '<identifier>b</identifier>' +227 '</children>' +228 '</prefixop>' +229 '</children>' +230 '</postfixop>' +231 '</children>' +232 '</infixop>');233 // Three identifiers with pre- and postfixes.234 this.executeTreeTest(235 '<mo>+</mo><mo>+</mo><mi>a</mi><mo>\u2213</mo><mo>+</mo>' +236 '<mi>b</mi><mo>+</mo><mo>\u2213</mo><mi>c</mi><mo>+</mo>',237 '<infixop>+' +238 '<content><operator>+</operator></content>' +239 '<children>' +240 '<infixop>\u2213' +241 '<content><operator>\u2213</operator></content>' +242 '<children>' +243 '<prefixop>+ +' +244 '<content><operator>+</operator><operator>+</operator></content>' +245 '<children>' +246 '<identifier>a</identifier>' +247 '</children>' +248 '</prefixop>' +249 '<prefixop>+' +250 '<content><operator>+</operator></content>' +251 '<children>' +252 '<identifier>b</identifier>' +253 '</children>' +254 '</prefixop>' +255 '</children>' +256 '</infixop>' +257 '<postfixop>+' +258 '<content><operator>+</operator></content>' +259 '<children>' +260 '<prefixop>\u2213' +261 '<content><operator>\u2213</operator></content>' +262 '<children>' +263 '<identifier>c</identifier>' +264 '</children>' +265 '</prefixop>' +266 '</children>' +267 '</postfixop>' +268 '</children>' +269 '</infixop>');270});271/**272 * Test operator trees with single operator.273 */274TEST_F('CvoxSemanticTreeUnitTest', 'StreeSingleOperators', function() {275 this.brief = true;276 // Single identifier.277 this.executeTreeTest(278 '<mi>a</mi>',279 '<identifier>a</identifier>');280 // Single implicit node.281 this.executeTreeTest(282 '<mi>a</mi><mi>b</mi>',283 '<infixop>\u2062' +284 '<content><operator>\u2062</operator></content>' +285 '<children>' +286 '<identifier>a</identifier>' +287 '<identifier>b</identifier>' +288 '</children>' +289 '</infixop>');290 // Implicit multi node.291 this.executeTreeTest(292 '<mi>a</mi><mi>b</mi><mi>c</mi>',293 '<infixop>\u2062' +294 '<content><operator>\u2062</operator></content>' +295 '<children>' +296 '<identifier>a</identifier>' +297 '<identifier>b</identifier>' +298 '<identifier>c</identifier>' +299 '</children>' +300 '</infixop>');301 // Single addition.302 this.executeTreeTest(303 '<mi>a</mi><mo>+</mo><mi>b</mi>',304 '<infixop>+' +305 '<content><operator>+</operator></content>' +306 '<children>' +307 '<identifier>a</identifier>' +308 '<identifier>b</identifier>' +309 '</children>' +310 '</infixop>');311 // Multi addition.312 this.executeTreeTest(313 '<mi>a</mi><mo>+</mo><mi>b</mi><mo>+</mo><mi>c</mi>',314 '<infixop>+' +315 '<content><operator>+</operator><operator>+</operator></content>' +316 '<children>' +317 '<identifier>a</identifier>' +318 '<identifier>b</identifier>' +319 '<identifier>c</identifier>' +320 '</children>' +321 '</infixop>');322 // Multi addition with implicit node.323 this.executeTreeTest(324 '<mi>a</mi><mo>+</mo><mi>b</mi><mi>c</mi><mo>+</mo><mi>d</mi>',325 '<infixop>+' +326 '<content><operator>+</operator><operator>+</operator></content>' +327 '<children>' +328 '<identifier>a</identifier>' +329 '<infixop>\u2062' +330 '<content><operator>\u2062</operator></content>' +331 '<children>' +332 '<identifier>b</identifier>' +333 '<identifier>c</identifier>' +334 '</children>' +335 '</infixop>' +336 '<identifier>d</identifier>' +337 '</children>' +338 '</infixop>');339});340/**341 * Test operator trees with multiple operators.342 */343TEST_F('CvoxSemanticTreeUnitTest', 'StreeMultipleOperators', function() {344 this.brief = true;345 // Addition and subtraction.346 this.executeTreeTest(347 '<mi>a</mi><mo>+</mo><mi>b</mi><mo>-</mo><mi>c</mi><mo>+</mo><mi>d</mi>',348 '<infixop>+' +349 '<content><operator>+</operator></content>' +350 '<children>' +351 '<infixop>-' +352 '<content><operator>-</operator></content>' +353 '<children>' +354 '<infixop>+' +355 '<content><operator>+</operator></content>' +356 '<children>' +357 '<identifier>a</identifier>' +358 '<identifier>b</identifier>' +359 '</children>' +360 '</infixop>' +361 '<identifier>c</identifier>' +362 '</children>' +363 '</infixop>' +364 '<identifier>d</identifier>' +365 '</children>' +366 '</infixop>');367 // Addition and subtraction.368 this.executeTreeTest(369 '<mi>a</mi><mo>+</mo><mi>b</mi><mo>+</mo><mi>c</mi><mo>-</mo>' +370 '<mi>d</mi><mo>-</mo><mi>e</mi>',371 '<infixop>-' +372 '<content><operator>-</operator><operator>-</operator></content>' +373 '<children>' +374 '<infixop>+' +375 '<content><operator>+</operator><operator>+</operator></content>' +376 '<children>' +377 '<identifier>a</identifier>' +378 '<identifier>b</identifier>' +379 '<identifier>c</identifier>' +380 '</children>' +381 '</infixop>' +382 '<identifier>d</identifier>' +383 '<identifier>e</identifier>' +384 '</children>' +385 '</infixop>');386 // Addition and explicit multiplication.387 this.executeTreeTest(388 '<mi>a</mi><mo>+</mo><mi>b</mi><mo>\u2218</mo><mi>c</mi><mo>+</mo>' +389 '<mi>d</mi>',390 '<infixop>+' +391 '<content><operator>+</operator><operator>+</operator></content>' +392 '<children>' +393 '<identifier>a</identifier>' +394 '<infixop>\u2218' +395 '<content><operator>\u2218</operator></content>' +396 '<children>' +397 '<identifier>b</identifier>' +398 '<identifier>c</identifier>' +399 '</children>' +400 '</infixop>' +401 '<identifier>d</identifier>' +402 '</children>' +403 '</infixop>');404 // Addition with explicit and implicit multiplication.405 this.executeTreeTest(406 '<mi>a</mi><mo>+</mo><mi>b</mi><mo>\u2218</mo><mi>c</mi><mi>d</mi>' +407 '<mo>+</mo><mi>e</mi><mo>\u2218</mo><mi>f</mi>',408 '<infixop>+' +409 '<content><operator>+</operator><operator>+</operator></content>' +410 '<children>' +411 '<identifier>a</identifier>' +412 '<infixop>\u2218' +413 '<content><operator>\u2218</operator></content>' +414 '<children>' +415 '<identifier>b</identifier>' +416 '<infixop>\u2062' +417 '<content><operator>\u2062</operator></content>' +418 '<children>' +419 '<identifier>c</identifier>' +420 '<identifier>d</identifier>' +421 '</children>' +422 '</infixop>' +423 '</children>' +424 '</infixop>' +425 '<infixop>\u2218' +426 '<content><operator>\u2218</operator></content>' +427 '<children>' +428 '<identifier>e</identifier>' +429 '<identifier>f</identifier>' +430 '</children>' +431 '</infixop>' +432 '</children>' +433 '</infixop>');434 // Two Additions, subtraction plus explicit and implicit multiplication,435 // one prefix and one postfix.436 this.executeTreeTest(437 '<mi>a</mi><mo>+</mo><mi>b</mi><mo>+</mo><mi>c</mi><mi>d</mi>' +438 '<mo>+</mo><mi>e</mi><mo>\u2218</mo><mi>f</mi><mo>-</mo><mi>g</mi>' +439 '<mo>+</mo><mo>+</mo><mi>h</mi><mo>\u2295</mo><mi>i</mi>' +440 '<mo>\u2295</mo><mi>j</mi><mo>+</mo><mo>+</mo>',441 '<infixop>\u2295' +442 '<content><operator>\u2295</operator>' +443 '<operator>\u2295</operator></content>' +444 '<children>' +445 '<infixop>+' +446 '<content><operator>+</operator></content>' +447 '<children>' +448 '<infixop>-' +449 '<content><operator>-</operator></content>' +450 '<children>' +451 '<infixop>+' +452 '<content><operator>+</operator>' +453 '<operator>+</operator><operator>+</operator></content>' +454 '<children>' +455 '<identifier>a</identifier>' +456 '<identifier>b</identifier>' +457 '<infixop>\u2062' +458 '<content><operator>\u2062</operator></content>' +459 '<children>' +460 '<identifier>c</identifier>' +461 '<identifier>d</identifier>' +462 '</children>' +463 '</infixop>' +464 '<infixop>\u2218' +465 '<content><operator>\u2218</operator></content>' +466 '<children>' +467 '<identifier>e</identifier>' +468 '<identifier>f</identifier>' +469 '</children>' +470 '</infixop>' +471 '</children>' +472 '</infixop>' +473 '<identifier>g</identifier>' +474 '</children>' +475 '</infixop>' +476 '<prefixop>+' +477 '<content><operator>+</operator></content>' +478 '<children>' +479 '<identifier>h</identifier>' +480 '</children>' +481 '</prefixop>' +482 '</children>' +483 '</infixop>' +484 '<identifier>i</identifier>' +485 '<postfixop>+ +' +486 '<content><operator>+</operator><operator>+</operator></content>' +487 '<children>' +488 '<identifier>j</identifier>' +489 '</children>' +490 '</postfixop>' +491 '</children>' +492 '</infixop>');493});494// Fences.495/**496 * Test regular directed fences.497 */498TEST_F('CvoxSemanticTreeUnitTest', 'StreeRegularFences', function() {499 this.brief = true;500 // No fence.501 this.executeTreeTest(502 '<mrow><mi>a</mi><mo>+</mo><mi>b</mi></mrow>',503 '<infixop>+' +504 '<content>' +505 '<operator>+</operator>' +506 '</content>' +507 '<children>' +508 '<identifier>a</identifier>' +509 '<identifier>b</identifier>' +510 '</children>' +511 '</infixop>');512 // Empty parentheses.513 this.executeTreeTest(514 '<mrow><mo>(</mo><mo>)</mo></mrow>',515 '<fenced>' +516 '<content>' +517 '<fence>(</fence>' +518 '<fence>)</fence>' +519 '</content>' +520 '<children>' +521 '<empty/>' +522 '</children>' +523 '</fenced>');524 // Single Fenced Expression.525 this.executeTreeTest(526 '<mrow><mo>(</mo><mi>a</mi><mo>+</mo><mi>b</mi><mo>)</mo></mrow>',527 '<fenced>' +528 '<content>' +529 '<fence>(</fence>' +530 '<fence>)</fence>' +531 '</content>' +532 '<children>' +533 '<infixop>+' +534 '<content>' +535 '<operator>+</operator>' +536 '</content>' +537 '<children>' +538 '<identifier>a</identifier>' +539 '<identifier>b</identifier>' +540 '</children>' +541 '</infixop>' +542 '</children>' +543 '</fenced>');544 // Single Fenced Expression and operators.545 this.executeTreeTest(546 '<mrow><mi>a</mi><mo>+</mo><mo>(</mo><mi>b</mi><mo>+</mo><mi>c</mi>' +547 '<mo>)</mo><mo>+</mo><mi>d</mi></mrow>',548 '<infixop>+' +549 '<content>' +550 '<operator>+</operator>' +551 '<operator>+</operator>' +552 '</content>' +553 '<children>' +554 '<identifier>a</identifier>' +555 '<fenced>' +556 '<content>' +557 '<fence>(</fence>' +558 '<fence>)</fence>' +559 '</content>' +560 '<children>' +561 '<infixop>+' +562 '<content>' +563 '<operator>+</operator>' +564 '</content>' +565 '<children>' +566 '<identifier>b</identifier>' +567 '<identifier>c</identifier>' +568 '</children>' +569 '</infixop>' +570 '</children>' +571 '</fenced>' +572 '<identifier>d</identifier>' +573 '</children>' +574 '</infixop>');575 // Parallel Parenthesis.576 this.executeTreeTest(577 '<mrow><mo>(</mo><mi>a</mi><mo>+</mo><mi>b</mi><mo>)</mo><mo>(</mo>' +578 '<mi>c</mi><mo>+</mo><mi>d</mi><mo>)</mo></mrow>',579 '<infixop>\u2062' +580 '<content>' +581 '<operator>\u2062</operator>' +582 '</content>' +583 '<children>' +584 '<fenced>' +585 '<content>' +586 '<fence>(</fence>' +587 '<fence>)</fence>' +588 '</content>' +589 '<children>' +590 '<infixop>+' +591 '<content>' +592 '<operator>+</operator>' +593 '</content>' +594 '<children>' +595 '<identifier>a</identifier>' +596 '<identifier>b</identifier>' +597 '</children>' +598 '</infixop>' +599 '</children>' +600 '</fenced>' +601 '<fenced>' +602 '<content>' +603 '<fence>(</fence>' +604 '<fence>)</fence>' +605 '</content>' +606 '<children>' +607 '<infixop>+' +608 '<content>' +609 '<operator>+</operator>' +610 '</content>' +611 '<children>' +612 '<identifier>c</identifier>' +613 '<identifier>d</identifier>' +614 '</children>' +615 '</infixop>' +616 '</children>' +617 '</fenced>' +618 '</children>' +619 '</infixop>');620 // Nested Parenthesis.621 this.executeTreeTest(622 '<mrow><mo>(</mo><mo>(</mo><mi>a</mi><mo>+</mo><mi>b</mi><mo>)</mo>' +623 '<mo>(</mo><mi>c</mi><mo>+</mo><mi>d</mi><mo>)</mo><mo>)</mo></mrow>',624 '<fenced>' +625 '<content>' +626 '<fence>(</fence>' +627 '<fence>)</fence>' +628 '</content>' +629 '<children>' +630 '<infixop>\u2062' +631 '<content>' +632 '<operator>\u2062</operator>' +633 '</content>' +634 '<children>' +635 '<fenced>' +636 '<content>' +637 '<fence>(</fence>' +638 '<fence>)</fence>' +639 '</content>' +640 '<children>' +641 '<infixop>+' +642 '<content>' +643 '<operator>+</operator>' +644 '</content>' +645 '<children>' +646 '<identifier>a</identifier>' +647 '<identifier>b</identifier>' +648 '</children>' +649 '</infixop>' +650 '</children>' +651 '</fenced>' +652 '<fenced>' +653 '<content>' +654 '<fence>(</fence>' +655 '<fence>)</fence>' +656 '</content>' +657 '<children>' +658 '<infixop>+' +659 '<content>' +660 '<operator>+</operator>' +661 '</content>' +662 '<children>' +663 '<identifier>c</identifier>' +664 '<identifier>d</identifier>' +665 '</children>' +666 '</infixop>' +667 '</children>' +668 '</fenced>' +669 '</children>' +670 '</infixop>' +671 '</children>' +672 '</fenced>');673 // Nested parenthesis and brackets.674 this.executeTreeTest(675 '<mrow><mo>(</mo><mo>[</mo><mi>a</mi><mo>+</mo><mi>b</mi><mo>+</mo>' +676 '<mi>c</mi><mo>]</mo><mo>+</mo><mi>d</mi><mo>)</mo></mrow>',677 '<fenced>' +678 '<content>' +679 '<fence>(</fence>' +680 '<fence>)</fence>' +681 '</content>' +682 '<children>' +683 '<infixop>+' +684 '<content>' +685 '<operator>+</operator>' +686 '</content>' +687 '<children>' +688 '<fenced>' +689 '<content>' +690 '<fence>[</fence>' +691 '<fence>]</fence>' +692 '</content>' +693 '<children>' +694 '<infixop>+' +695 '<content>' +696 '<operator>+</operator>' +697 '<operator>+</operator>' +698 '</content>' +699 '<children>' +700 '<identifier>a</identifier>' +701 '<identifier>b</identifier>' +702 '<identifier>c</identifier>' +703 '</children>' +704 '</infixop>' +705 '</children>' +706 '</fenced>' +707 '<identifier>d</identifier>' +708 '</children>' +709 '</infixop>' +710 '</children>' +711 '</fenced>');712 // Nested parenthesis, brackets, braces and superscript operator.713 this.executeTreeTest(714 '<mrow><mo>(</mo><msup><mi>a</mi><mrow><mn>2</mn><mo>[</mo><mi>i</mi>' +715 '<mo>+</mo><mi>n</mi><mo>]</mo></mrow></msup><mo>+</mo><mi>b</mi>' +716 '<mo>)</mo><mo>+</mo><mo>{</mo><mi>c</mi><mi>d</mi><mo>-</mo><mo>[</mo>' +717 '<mi>e</mi><mo>+</mo><mi>f</mi><mo>]</mo><mo>}</mo></mrow>',718 '<infixop>+' +719 '<content>' +720 '<operator>+</operator>' +721 '</content>' +722 '<children>' +723 '<fenced>' +724 '<content>' +725 '<fence>(</fence>' +726 '<fence>)</fence>' +727 '</content>' +728 '<children>' +729 '<infixop>+' +730 '<content>' +731 '<operator>+</operator>' +732 '</content>' +733 '<children>' +734 '<superscript>' +735 '<children>' +736 '<identifier>a</identifier>' +737 '<infixop>\u2062' +738 '<content>' +739 '<operator>\u2062</operator>' +740 '</content>' +741 '<children>' +742 '<number>2</number>' +743 '<fenced>' +744 '<content>' +745 '<fence>[</fence>' +746 '<fence>]</fence>' +747 '</content>' +748 '<children>' +749 '<infixop>+' +750 '<content>' +751 '<operator>+</operator>' +752 '</content>' +753 '<children>' +754 '<identifier>i</identifier>' +755 '<identifier>n</identifier>' +756 '</children>' +757 '</infixop>' +758 '</children>' +759 '</fenced>' +760 '</children>' +761 '</infixop>' +762 '</children>' +763 '</superscript>' +764 '<identifier>b</identifier>' +765 '</children>' +766 '</infixop>' +767 '</children>' +768 '</fenced>' +769 '<fenced>' +770 '<content>' +771 '<fence>{</fence>' +772 '<fence>}</fence>' +773 '</content>' +774 '<children>' +775 '<infixop>-' +776 '<content>' +777 '<operator>-</operator>' +778 '</content>' +779 '<children>' +780 '<infixop>\u2062' +781 '<content>' +782 '<operator>\u2062</operator>' +783 '</content>' +784 '<children>' +785 '<identifier>c</identifier>' +786 '<identifier>d</identifier>' +787 '</children>' +788 '</infixop>' +789 '<fenced>' +790 '<content>' +791 '<fence>[</fence>' +792 '<fence>]</fence>' +793 '</content>' +794 '<children>' +795 '<infixop>+' +796 '<content>' +797 '<operator>+</operator>' +798 '</content>' +799 '<children>' +800 '<identifier>e</identifier>' +801 '<identifier>f</identifier>' +802 '</children>' +803 '</infixop>' +804 '</children>' +805 '</fenced>' +806 '</children>' +807 '</infixop>' +808 '</children>' +809 '</fenced>' +810 '</children>' +811 '</infixop>');812});813/**814 * Test neutral fences.815 */816TEST_F('CvoxSemanticTreeUnitTest', 'StreeNeutralFences', function() {817 this.brief = true;818 // Empty bars.819 this.executeTreeTest(820 '<mrow><mo>|</mo><mo>|</mo></mrow>',821 '<fenced>' +822 '<content>' +823 '<fence>|</fence>' +824 '<fence>|</fence>' +825 '</content>' +826 '<children>' +827 '<empty/>' +828 '</children>' +829 '</fenced>');830 // Simple bar fence.831 this.executeTreeTest(832 '<mrow><mo>|</mo><mi>a</mi><mo>|</mo></mrow>',833 '<fenced>' +834 '<content>' +835 '<fence>|</fence>' +836 '<fence>|</fence>' +837 '</content>' +838 '<children>' +839 '<identifier>a</identifier>' +840 '</children>' +841 '</fenced>');842 // Parallel bar fences.843 this.executeTreeTest(844 '<mrow><mo>|</mo><mi>a</mi><mo>|</mo><mi>b</mi><mo>+</mo>' +845 '<mo>\u00A6</mo><mi>c</mi><mo>\u00A6</mo></mrow>',846 '<infixop>+' +847 '<content>' +848 '<operator>+</operator>' +849 '</content>' +850 '<children>' +851 '<infixop>\u2062' +852 '<content>' +853 '<operator>\u2062</operator>' +854 '</content>' +855 '<children>' +856 '<fenced>' +857 '<content>' +858 '<fence>|</fence>' +859 '<fence>|</fence>' +860 '</content>' +861 '<children>' +862 '<identifier>a</identifier>' +863 '</children>' +864 '</fenced>' +865 '<identifier>b</identifier>' +866 '</children>' +867 '</infixop>' +868 '<fenced>' +869 '<content>' +870 '<fence>\u00A6</fence>' +871 '<fence>\u00A6</fence>' +872 '</content>' +873 '<children>' +874 '<identifier>c</identifier>' +875 '</children>' +876 '</fenced>' +877 '</children>' +878 '</infixop>');879 // Nested bar fences.880 this.executeTreeTest(881 '<mrow><mo>\u00A6</mo><mo>|</mo><mi>a</mi><mo>|</mo><mi>b</mi>' +882 '<mo>+</mo><mi>c</mi><mo>\u00A6</mo></mrow>',883 '<fenced>' +884 '<content>' +885 '<fence>\u00A6</fence>' +886 '<fence>\u00A6</fence>' +887 '</content>' +888 '<children>' +889 '<infixop>+' +890 '<content>' +891 '<operator>+</operator>' +892 '</content>' +893 '<children>' +894 '<infixop>\u2062' +895 '<content>' +896 '<operator>\u2062</operator>' +897 '</content>' +898 '<children>' +899 '<fenced>' +900 '<content>' +901 '<fence>|</fence>' +902 '<fence>|</fence>' +903 '</content>' +904 '<children>' +905 '<identifier>a</identifier>' +906 '</children>' +907 '</fenced>' +908 '<identifier>b</identifier>' +909 '</children>' +910 '</infixop>' +911 '<identifier>c</identifier>' +912 '</children>' +913 '</infixop>' +914 '</children>' +915 '</fenced>');916});917/**918 * Mixed neutral and regular fences.919 */920TEST_F('CvoxSemanticTreeUnitTest', 'StreeMixedFences', function() {921 this.brief = true;922 // Empty parenthsis inside bars.923 this.executeTreeTest(924 '<mrow><mo>|</mo><mo>(</mo><mo>)</mo><mo>|</mo></mrow>',925 '<fenced>' +926 '<content>' +927 '<fence>|</fence>' +928 '<fence>|</fence>' +929 '</content>' +930 '<children>' +931 '<fenced>' +932 '<content>' +933 '<fence>(</fence>' +934 '<fence>)</fence>' +935 '</content>' +936 '<children>' +937 '<empty/>' +938 '</children>' +939 '</fenced>' +940 '</children>' +941 '</fenced>');942 // Bars inside parentheses.943 this.executeTreeTest(944 '<mrow><mo>(</mo><mo>|</mo><mi>a</mi><mo>|</mo><mi>b</mi>' +945 '<mo>&#x00A6;</mo><mi>c</mi><mo>&#x00A6;</mo><mi>d</mi>' +946 '<mo>)</mo></mrow>',947 '<fenced>' +948 '<content>' +949 '<fence>(</fence>' +950 '<fence>)</fence>' +951 '</content>' +952 '<children>' +953 '<infixop>\u2062' +954 '<content>' +955 '<operator>\u2062</operator>' +956 '</content>' +957 '<children>' +958 '<fenced>' +959 '<content>' +960 '<fence>|</fence>' +961 '<fence>|</fence>' +962 '</content>' +963 '<children>' +964 '<identifier>a</identifier>' +965 '</children>' +966 '</fenced>' +967 '<identifier>b</identifier>' +968 '<fenced>' +969 '<content>' +970 '<fence>\u00A6</fence>' +971 '<fence>\u00A6</fence>' +972 '</content>' +973 '<children>' +974 '<identifier>c</identifier>' +975 '</children>' +976 '</fenced>' +977 '<identifier>d</identifier>' +978 '</children>' +979 '</infixop>' +980 '</children>' +981 '</fenced>');982 // Parentheses inside bards.983 this.executeTreeTest(984 '<mrow><mo>|</mo><mo>(</mo><mi>a</mi><mo>+</mo><mi>b</mi><mo>)</mo>' +985 '<mo>&#x00A6;</mo><mi>c</mi><mo>&#x00A6;</mo><mi>d</mi><mo>|</mo></mrow>',986 '<fenced>' +987 '<content>' +988 '<fence>|</fence>' +989 '<fence>|</fence>' +990 '</content>' +991 '<children>' +992 '<infixop>\u2062' +993 '<content>' +994 '<operator>\u2062</operator>' +995 '</content>' +996 '<children>' +997 '<fenced>' +998 '<content>' +999 '<fence>(</fence>' +1000 '<fence>)</fence>' +1001 '</content>' +1002 '<children>' +1003 '<infixop>+' +1004 '<content>' +1005 '<operator>+</operator>' +1006 '</content>' +1007 '<children>' +1008 '<identifier>a</identifier>' +1009 '<identifier>b</identifier>' +1010 '</children>' +1011 '</infixop>' +1012 '</children>' +1013 '</fenced>' +1014 '<fenced>' +1015 '<content>' +1016 '<fence>\u00A6</fence>' +1017 '<fence>\u00A6</fence>' +1018 '</content>' +1019 '<children>' +1020 '<identifier>c</identifier>' +1021 '</children>' +1022 '</fenced>' +1023 '<identifier>d</identifier>' +1024 '</children>' +1025 '</infixop>' +1026 '</children>' +1027 '</fenced>');1028 // Parentheses inside bards.1029 this.executeTreeTest(1030 '<mrow><mo>[</mo><mo>|</mo><mi>a</mi><mo>+</mo><mi>b</mi><mo>|</mo>' +1031 '<mo>+</mo><mi>c</mi><mo>]</mo><mo>+</mo><mo>\u00A6</mo><mi>d</mi>' +1032 '<mo>+</mo><mo>(</mo><mi>e</mi><mo>+</mo><mi>f</mi><mo>)</mo>' +1033 '<mo>\u00A6</mo></mrow>',1034 '<infixop>+' +1035 '<content>' +1036 '<operator>+</operator>' +1037 '</content>' +1038 '<children>' +1039 '<fenced>' +1040 '<content>' +1041 '<fence>[</fence>' +1042 '<fence>]</fence>' +1043 '</content>' +1044 '<children>' +1045 '<infixop>+' +1046 '<content>' +1047 '<operator>+</operator>' +1048 '</content>' +1049 '<children>' +1050 '<fenced>' +1051 '<content>' +1052 '<fence>|</fence>' +1053 '<fence>|</fence>' +1054 '</content>' +1055 '<children>' +1056 '<infixop>+' +1057 '<content>' +1058 '<operator>+</operator>' +1059 '</content>' +1060 '<children>' +1061 '<identifier>a</identifier>' +1062 '<identifier>b</identifier>' +1063 '</children>' +1064 '</infixop>' +1065 '</children>' +1066 '</fenced>' +1067 '<identifier>c</identifier>' +1068 '</children>' +1069 '</infixop>' +1070 '</children>' +1071 '</fenced>' +1072 '<fenced>' +1073 '<content>' +1074 '<fence>\u00A6</fence>' +1075 '<fence>\u00A6</fence>' +1076 '</content>' +1077 '<children>' +1078 '<infixop>+' +1079 '<content>' +1080 '<operator>+</operator>' +1081 '</content>' +1082 '<children>' +1083 '<identifier>d</identifier>' +1084 '<fenced>' +1085 '<content>' +1086 '<fence>(</fence>' +1087 '<fence>)</fence>' +1088 '</content>' +1089 '<children>' +1090 '<infixop>+' +1091 '<content>' +1092 '<operator>+</operator>' +1093 '</content>' +1094 '<children>' +1095 '<identifier>e</identifier>' +1096 '<identifier>f</identifier>' +1097 '</children>' +1098 '</infixop>' +1099 '</children>' +1100 '</fenced>' +1101 '</children>' +1102 '</infixop>' +1103 '</children>' +1104 '</fenced>' +1105 '</children>' +1106 '</infixop>');1107});1108/**1109 * Mixed with isolated bars.1110 */1111TEST_F('CvoxSemanticTreeUnitTest', 'StreeMixedFencesWithBars', function() {1112 this.brief = true;1113 this.xpathBlacklist = ['descendant::punctuated/content'];1114 // Set notation.1115 this.executeTreeTest(1116 '<mrow><mo>{</mo><mo>(</mo><mi>x</mi><mo>,</mo><mi>y</mi><mo>,</mo>' +1117 '<mi>z</mi><mo>)</mo><mo>|</mo><mi>x</mi><mi>y</mi><mo>=</mo>' +1118 '<mo>z</mo><mo>}</mo></mrow>',1119 '<fenced>' +1120 '<content>' +1121 '<fence>{</fence>' +1122 '<fence>}</fence>' +1123 '</content>' +1124 '<children>' +1125 '<punctuated>' +1126 '<children>' +1127 '<fenced>' +1128 '<content>' +1129 '<fence>(</fence>' +1130 '<fence>)</fence>' +1131 '</content>' +1132 '<children>' +1133 '<punctuated>' +1134 '<children>' +1135 '<identifier>x</identifier>' +1136 '<punctuation>,</punctuation>' +1137 '<identifier>y</identifier>' +1138 '<punctuation>,</punctuation>' +1139 '<identifier>z</identifier>' +1140 '</children>' +1141 '</punctuated>' +1142 '</children>' +1143 '</fenced>' +1144 '<punctuation>|</punctuation>' +1145 '<relseq>=' +1146 '<content>' +1147 '<relation>=</relation>' +1148 '</content>' +1149 '<children>' +1150 '<infixop>\u2062' +1151 '<content>' +1152 '<operator>\u2062</operator>' +1153 '</content>' +1154 '<children>' +1155 '<identifier>x</identifier>' +1156 '<identifier>y</identifier>' +1157 '</children>' +1158 '</infixop>' +1159 '<identifier>z</identifier>' +1160 '</children>' +1161 '</relseq>' +1162 '</children>' +1163 '</punctuated>' +1164 '</children>' +1165 '</fenced>');1166 // Disjunction of bracketed parallel statements.1167 this.executeTreeTest(1168 '<mrow><mo>[</mo><mi>a</mi><mo>&#x2016;</mo><mi>b</mi><mo>]</mo>' +1169 '<mo>|</mo><mo>[</mo><mi>x</mi><mo>&#x2016;</mo><mi>y</mi><mo>]</mo>' +1170 '</mrow>',1171 '<punctuated>' +1172 '<children>' +1173 '<fenced>' +1174 '<content>' +1175 '<fence>[</fence>' +1176 '<fence>]</fence>' +1177 '</content>' +1178 '<children>' +1179 '<punctuated>' +1180 '<children>' +1181 '<identifier>a</identifier>' +1182 '<punctuation>\u2016</punctuation>' +1183 '<identifier>b</identifier>' +1184 '</children>' +1185 '</punctuated>' +1186 '</children>' +1187 '</fenced>' +1188 '<punctuation>|</punctuation>' +1189 '<fenced>' +1190 '<content>' +1191 '<fence>[</fence>' +1192 '<fence>]</fence>' +1193 '</content>' +1194 '<children>' +1195 '<punctuated>' +1196 '<children>' +1197 '<identifier>x</identifier>' +1198 '<punctuation>\u2016</punctuation>' +1199 '<identifier>y</identifier>' +1200 '</children>' +1201 '</punctuated>' +1202 '</children>' +1203 '</fenced>' +1204 '</children>' +1205 '</punctuated>'1206 );1207 // Metric over the above.1208 this.executeTreeTest(1209 '<mrow><mo>&#x2016;</mo><mo>[</mo><mi>a</mi><mo>&#x2016;</mo>' +1210 '<mi>b</mi><mo>]</mo><mo>|</mo><mo>[</mo><mi>x</mi><mo>&#x2016;</mo>' +1211 '<mi>y</mi><mo>]</mo><mo>&#x2016;</mo></mrow>',1212 '<fenced>' +1213 '<content>' +1214 '<fence>\u2016</fence>' +1215 '<fence>\u2016</fence>' +1216 '</content>' +1217 '<children>' +1218 '<punctuated>' +1219 '<children>' +1220 '<fenced>' +1221 '<content>' +1222 '<fence>[</fence>' +1223 '<fence>]</fence>' +1224 '</content>' +1225 '<children>' +1226 '<punctuated>' +1227 '<children>' +1228 '<identifier>a</identifier>' +1229 '<punctuation>\u2016</punctuation>' +1230 '<identifier>b</identifier>' +1231 '</children>' +1232 '</punctuated>' +1233 '</children>' +1234 '</fenced>' +1235 '<punctuation>|</punctuation>' +1236 '<fenced>' +1237 '<content>' +1238 '<fence>[</fence>' +1239 '<fence>]</fence>' +1240 '</content>' +1241 '<children>' +1242 '<punctuated>' +1243 '<children>' +1244 '<identifier>x</identifier>' +1245 '<punctuation>\u2016</punctuation>' +1246 '<identifier>y</identifier>' +1247 '</children>' +1248 '</punctuated>' +1249 '</children>' +1250 '</fenced>' +1251 '</children>' +1252 '</punctuated>' +1253 '</children>' +1254 '</fenced>');1255 // Mix of metrics and bracketed expression and single bars.1256 this.executeTreeTest(1257 '<mrow><mo>&#x2016;</mo><mo>[</mo><mi>a</mi><mo>&#x2016;</mo><mi>b</mi>' +1258 '<mo>]</mo><mo>|</mo><mo>[</mo><mi>c</mi><mo>&#x2016;</mo>' +1259 '<mo>&#x00A6;</mo><mi>d</mi><mo>]</mo><mo>&#x2016;</mo><mo>[</mo>' +1260 '<mi>u</mi><mo>&#x2016;</mo><mi>v</mi><mo>]</mo><mo>|</mo><mi>x</mi>' +1261 '<mo>&#x2016;</mo><mi>y</mi><mo>&#x00A6;</mo><mi>z</mi></mrow>',1262 '<punctuated>' +1263 '<children>' +1264 '<infixop>\u2062' +1265 '<content>' +1266 '<operator>\u2062</operator>' +1267 '</content>' +1268 '<children>' +1269 '<fenced>' +1270 '<content>' +1271 '<fence>\u2016</fence>' +1272 '<fence>\u2016</fence>' +1273 '</content>' +1274 '<children>' +1275 '<punctuated>' +1276 '<children>' +1277 '<fenced>' +1278 '<content>' +1279 '<fence>[</fence>' +1280 '<fence>]</fence>' +1281 '</content>' +1282 '<children>' +1283 '<punctuated>' +1284 '<children>' +1285 '<identifier>a</identifier>' +1286 '<punctuation>\u2016</punctuation>' +1287 '<identifier>b</identifier>' +1288 '</children>' +1289 '</punctuated>' +1290 '</children>' +1291 '</fenced>' +1292 '<punctuation>|</punctuation>' +1293 '<fenced>' +1294 '<content>' +1295 '<fence>[</fence>' +1296 '<fence>]</fence>' +1297 '</content>' +1298 '<children>' +1299 '<punctuated>' +1300 '<children>' +1301 '<identifier>c</identifier>' +1302 '<punctuation>\u2016</punctuation>' +1303 '<punctuation>\u00A6</punctuation>' +1304 '<identifier>d</identifier>' +1305 '</children>' +1306 '</punctuated>' +1307 '</children>' +1308 '</fenced>' +1309 '</children>' +1310 '</punctuated>' +1311 '</children>' +1312 '</fenced>' +1313 '<fenced>' +1314 '<content>' +1315 '<fence>[</fence>' +1316 '<fence>]</fence>' +1317 '</content>' +1318 '<children>' +1319 '<punctuated>' +1320 '<children>' +1321 '<identifier>u</identifier>' +1322 '<punctuation>\u2016</punctuation>' +1323 '<identifier>v</identifier>' +1324 '</children>' +1325 '</punctuated>' +1326 '</children>' +1327 '</fenced>' +1328 '</children>' +1329 '</infixop>' +1330 '<punctuation>|</punctuation>' +1331 '<identifier>x</identifier>' +1332 '<punctuation>\u2016</punctuation>' +1333 '<identifier>y</identifier>' +1334 '<punctuation>\u00A6</punctuation>' +1335 '<identifier>z</identifier>' +1336 '</children>' +1337 '</punctuated>');1338 this.xpathBlacklist = [];1339});1340/**1341 * Pathological cases with only opening fences.1342 */1343TEST_F('CvoxSemanticTreeUnitTest', 'StreeOpeningFencesOnly', function() {1344 this.brief = true;1345 this.xpathBlacklist = ['descendant::punctuated/content'];1346 // Single.1347 this.executeTreeTest(1348 '<mrow><mo>[</mo></mrow>',1349 '<fence>[</fence>');1350 // Single right.1351 this.executeTreeTest(1352 '<mrow><mi>a</mi><mo>[</mo></mrow>',1353 '<punctuated>' +1354 '<children>' +1355 '<identifier>a</identifier>' +1356 '<punctuation>[</punctuation>' +1357 '</children>' +1358 '</punctuated>');1359 // Single middle.1360 this.executeTreeTest(1361 '<mrow><mi>a</mi><mo>[</mo><mi>b</mi></mrow>',1362 '<punctuated>' +1363 '<children>' +1364 '<identifier>a</identifier>' +1365 '<punctuation>[</punctuation>' +1366 '<identifier>b</identifier>' +1367 '</children>' +1368 '</punctuated>');1369 // Single left.1370 this.executeTreeTest(1371 '<mrow><mo>[</mo><mi>b</mi></mrow>',1372 '<punctuated>' +1373 '<children>' +1374 '<punctuation>[</punctuation>' +1375 '<identifier>b</identifier>' +1376 '</children>' +1377 '</punctuated>');1378 // Multiple.1379 this.executeTreeTest(1380 '<mrow><mi>a</mi><mo>[</mo><mi>b</mi><mi>c</mi><mo>(</mo><mi>d</mi>' +1381 '<mo>{</mo><mi>e</mi><mo>&#x3008;</mo><mi>f</mi></mrow>',1382 '<punctuated>' +1383 '<children>' +1384 '<identifier>a</identifier>' +1385 '<punctuation>[</punctuation>' +1386 '<infixop>\u2062' +1387 '<content>' +1388 '<operator>\u2062</operator>' +1389 '</content>' +1390 '<children>' +1391 '<identifier>b</identifier>' +1392 '<identifier>c</identifier>' +1393 '</children>' +1394 '</infixop>' +1395 '<punctuation>(</punctuation>' +1396 '<identifier>d</identifier>' +1397 '<punctuation>{</punctuation>' +1398 '<identifier>e</identifier>' +1399 '<punctuation>\u3008</punctuation>' +1400 '<identifier>f</identifier>' +1401 '</children>' +1402 '</punctuated>');1403 // Multiple plus inner fenced.1404 this.executeTreeTest(1405 '<mrow><mi>a</mi><mo>[</mo><mi>b</mi><mo>[</mo><mo>(</mo><mo>(</mo>' +1406 '<mi>c</mi><mo>)</mo><mi>d</mi><mo>{</mo><mi>e</mi><mo>&#x3008;</mo>' +1407 '<mi>f</mi></mrow>',1408 '<punctuated>' +1409 '<children>' +1410 '<identifier>a</identifier>' +1411 '<punctuation>[</punctuation>' +1412 '<identifier>b</identifier>' +1413 '<punctuation>[</punctuation>' +1414 '<punctuation>(</punctuation>' +1415 '<infixop>\u2062' +1416 '<content>' +1417 '<operator>\u2062</operator>' +1418 '</content>' +1419 '<children>' +1420 '<fenced>' +1421 '<content>' +1422 '<fence>(</fence>' +1423 '<fence>)</fence>' +1424 '</content>' +1425 '<children>' +1426 '<identifier>c</identifier>' +1427 '</children>' +1428 '</fenced>' +1429 '<identifier>d</identifier>' +1430 '</children>' +1431 '</infixop>' +1432 '<punctuation>{</punctuation>' +1433 '<identifier>e</identifier>' +1434 '<punctuation>\u3008</punctuation>' +1435 '<identifier>f</identifier>' +1436 '</children>' +1437 '</punctuated>');1438 this.xpathBlacklist = [];1439});1440/**1441 * Pathological cases with only closing fences.1442 */1443TEST_F('CvoxSemanticTreeUnitTest', 'StreeClosingFencesOnly', function() {1444 this.brief = true;1445 this.xpathBlacklist = ['descendant::punctuated/content'];1446 // Single.1447 this.executeTreeTest(1448 '<mrow><mo>]</mo></mrow>',1449 '<fence>]</fence>');1450 // Single right.1451 this.executeTreeTest(1452 '<mrow><mi>a</mi><mo>]</mo></mrow>',1453 '<punctuated>' +1454 '<children>' +1455 '<identifier>a</identifier>' +1456 '<punctuation>]</punctuation>' +1457 '</children>' +1458 '</punctuated>');1459 // Single middle.1460 this.executeTreeTest(1461 '<mrow><mi>a</mi><mo>]</mo><mi>b</mi></mrow>',1462 '<punctuated>' +1463 '<children>' +1464 '<identifier>a</identifier>' +1465 '<punctuation>]</punctuation>' +1466 '<identifier>b</identifier>' +1467 '</children>' +1468 '</punctuated>');1469 // Single left.1470 this.executeTreeTest(1471 '<mrow><mo>]</mo><mi>b</mi></mrow>',1472 '<punctuated>' +1473 '<children>' +1474 '<punctuation>]</punctuation>' +1475 '<identifier>b</identifier>' +1476 '</children>' +1477 '</punctuated>');1478 // Multiple.1479 this.executeTreeTest(1480 '<mrow><mi>a</mi><mo>]</mo><mi>b</mi><mi>c</mi><mo>)</mo><mi>d</mi>' +1481 '<mo>}</mo><mi>e</mi><mo>&#x3009;</mo><mi>f</mi></mrow>',1482 '<punctuated>' +1483 '<children>' +1484 '<identifier>a</identifier>' +1485 '<punctuation>]</punctuation>' +1486 '<infixop>\u2062' +1487 '<content>' +1488 '<operator>\u2062</operator>' +1489 '</content>' +1490 '<children>' +1491 '<identifier>b</identifier>' +1492 '<identifier>c</identifier>' +1493 '</children>' +1494 '</infixop>' +1495 '<punctuation>)</punctuation>' +1496 '<identifier>d</identifier>' +1497 '<punctuation>}</punctuation>' +1498 '<identifier>e</identifier>' +1499 '<punctuation>\u3009</punctuation>' +1500 '<identifier>f</identifier>' +1501 '</children>' +1502 '</punctuated>');1503 // Multiple plus inner fenced.1504 this.executeTreeTest(1505 '<mrow><mi>a</mi><mo>]</mo><mi>b</mi><mo>]</mo><mo>(</mo><mi>c</mi>' +1506 '<mo>)</mo><mo>)</mo><mi>d</mi><mo>}</mo><mi>e</mi><mo>&#x3009;</mo>' +1507 '<mi>f</mi></mrow>',1508 '<punctuated>' +1509 '<children>' +1510 '<identifier>a</identifier>' +1511 '<punctuation>]</punctuation>' +1512 '<identifier>b</identifier>' +1513 '<punctuation>]</punctuation>' +1514 '<fenced>' +1515 '<content>' +1516 '<fence>(</fence>' +1517 '<fence>)</fence>' +1518 '</content>' +1519 '<children>' +1520 '<identifier>c</identifier>' +1521 '</children>' +1522 '</fenced>' +1523 '<punctuation>)</punctuation>' +1524 '<identifier>d</identifier>' +1525 '<punctuation>}</punctuation>' +1526 '<identifier>e</identifier>' +1527 '<punctuation>\u3009</punctuation>' +1528 '<identifier>f</identifier>' +1529 '</children>' +1530 '</punctuated>');1531 this.xpathBlacklist = [];1532});1533/**1534 * Pathological cases with only neutral fences.1535 */1536TEST_F('CvoxSemanticTreeUnitTest', 'StreeNeutralFencesOnly', function() {1537 this.brief = true;1538 this.xpathBlacklist = ['descendant::punctuated/content'];1539 // Single.1540 this.executeTreeTest(1541 '<mrow><mo>|</mo></mrow>',1542 '<fence>|</fence>');1543 // Single right.1544 this.executeTreeTest(1545 '<mrow><mi>a</mi><mo>|</mo></mrow>',1546 '<punctuated>' +1547 '<children>' +1548 '<identifier>a</identifier>' +1549 '<punctuation>|</punctuation>' +1550 '</children>' +1551 '</punctuated>');1552 // Single middle.1553 this.executeTreeTest(1554 '<mrow><mi>a</mi><mo>|</mo><mi>b</mi></mrow>',1555 '<punctuated>' +1556 '<children>' +1557 '<identifier>a</identifier>' +1558 '<punctuation>|</punctuation>' +1559 '<identifier>b</identifier>' +1560 '</children>' +1561 '</punctuated>');1562 // Single left.1563 this.executeTreeTest(1564 '<mrow><mo>|</mo><mi>b</mi></mrow>',1565 '<punctuated>' +1566 '<children>' +1567 '<punctuation>|</punctuation>' +1568 '<identifier>b</identifier>' +1569 '</children>' +1570 '</punctuated>');1571 // Two different bars.1572 this.executeTreeTest(1573 '<mrow><mi>a</mi><mo>|</mo><mi>b</mi><mo>&#x00A6;</mo><mi>c</mi></mrow>',1574 '<punctuated>' +1575 '<children>' +1576 '<identifier>a</identifier>' +1577 '<punctuation>|</punctuation>' +1578 '<identifier>b</identifier>' +1579 '<punctuation>\u00A6</punctuation>' +1580 '<identifier>c</identifier>' +1581 '</children>' +1582 '</punctuated>');1583 // Three different bars.1584 this.executeTreeTest(1585 '<mrow><mi>a</mi><mo>&#x2016;</mo><mi>b</mi><mo>|</mo><mi>c</mi>' +1586 '<mo>&#x00A6;</mo><mi>d</mi></mrow>',1587 '<punctuated>' +1588 '<children>' +1589 '<identifier>a</identifier>' +1590 '<punctuation>\u2016</punctuation>' +1591 '<identifier>b</identifier>' +1592 '<punctuation>|</punctuation>' +1593 '<identifier>c</identifier>' +1594 '<punctuation>\u00A6</punctuation>' +1595 '<identifier>d</identifier>' +1596 '</children>' +1597 '</punctuated>');1598 // Multiple plus inner fenced.1599 this.executeTreeTest(1600 '<mrow><mo>&#x2016;</mo><mo>[</mo><mi>a</mi><mo>&#x2016;</mo><mi>b</mi>' +1601 '<mo>]</mo><mo>&#x2016;</mo><mo>|</mo><mi>x</mi><mo>&#x2016;</mo>' +1602 '<mi>y</mi><mo>&#x00A6;</mo><mi>z</mi></mrow>',1603 '<punctuated>' +1604 '<children>' +1605 '<fenced>' +1606 '<content>' +1607 '<fence>\u2016</fence>' +1608 '<fence>\u2016</fence>' +1609 '</content>' +1610 '<children>' +1611 '<fenced>' +1612 '<content>' +1613 '<fence>[</fence>' +1614 '<fence>]</fence>' +1615 '</content>' +1616 '<children>' +1617 '<punctuated>' +1618 '<children>' +1619 '<identifier>a</identifier>' +1620 '<punctuation>\u2016</punctuation>' +1621 '<identifier>b</identifier>' +1622 '</children>' +1623 '</punctuated>' +1624 '</children>' +1625 '</fenced>' +1626 '</children>' +1627 '</fenced>' +1628 '<punctuation>|</punctuation>' +1629 '<identifier>x</identifier>' +1630 '<punctuation>\u2016</punctuation>' +1631 '<identifier>y</identifier>' +1632 '<punctuation>\u00A6</punctuation>' +1633 '<identifier>z</identifier>' +1634 '</children>' +1635 '</punctuated>');1636 this.xpathBlacklist = [];1637});1638/**1639 * Pathological cases with mixed fences.1640 */1641TEST_F('CvoxSemanticTreeUnitTest', 'StreeMixedUnmatchedFences', function() {1642 this.brief = true;1643 this.xpathBlacklist = ['descendant::punctuated/content'];1644 // Close, neutral, open.1645 this.executeTreeTest(1646 '<mrow><mo>]</mo><mo>&#x2016;</mo><mi>b</mi><mo>|</mo><mi>c</mi>' +1647 '<mo>(</mo></mrow>',1648 '<punctuated>' +1649 '<children>' +1650 '<punctuation>]</punctuation>' +1651 '<punctuation>\u2016</punctuation>' +1652 '<identifier>b</identifier>' +1653 '<punctuation>|</punctuation>' +1654 '<identifier>c</identifier>' +1655 '<punctuation>(</punctuation>' +1656 '</children>' +1657 '</punctuated>');1658 // Neutrals and close.1659 this.executeTreeTest(1660 '<mrow><mi>a</mi><mo>&#x2016;</mo><mi>b</mi><mo>|</mo><mi>c</mi>' +1661 '<mo>&#x00A6;</mo><mi>d</mi><mo>]</mo><mi>e</mi></mrow>',1662 '<punctuated>' +1663 '<children>' +1664 '<identifier>a</identifier>' +1665 '<punctuation>\u2016</punctuation>' +1666 '<identifier>b</identifier>' +1667 '<punctuation>|</punctuation>' +1668 '<identifier>c</identifier>' +1669 '<punctuation>\u00A6</punctuation>' +1670 '<identifier>d</identifier>' +1671 '<punctuation>]</punctuation>' +1672 '<identifier>e</identifier>' +1673 '</children>' +1674 '</punctuated>');1675 // Neutrals and open.1676 this.executeTreeTest(1677 '<mrow><mo>[</mo><mi>a</mi><mo>&#x2016;</mo><mi>b</mi><mo>|</mo>' +1678 '<mi>c</mi><mo>&#x00A6;</mo><mi>d</mi></mrow>',1679 '<punctuated>' +1680 '<children>' +1681 '<punctuation>[</punctuation>' +1682 '<identifier>a</identifier>' +1683 '<punctuation>\u2016</punctuation>' +1684 '<identifier>b</identifier>' +1685 '<punctuation>|</punctuation>' +1686 '<identifier>c</identifier>' +1687 '<punctuation>\u00A6</punctuation>' +1688 '<identifier>d</identifier>' +1689 '</children>' +1690 '</punctuated>');1691 // Multiple fences, fenced and operations1692 this.executeTreeTest(1693 '<mrow><mo>&#x2016;</mo><mo>[</mo><mi>a</mi><mo>&#x2016;</mo><mi>b</mi>' +1694 '<mo>]</mo><mo>|</mo><mo>[</mo><mi>c</mi><mo>&#x2016;</mo>' +1695 '<mo>&#x00A6;</mo><mi>d</mi><mo>]</mo><mo>&#x2016;</mo><mo>|</mo>' +1696 '<mi>x</mi><mo>&#x2016;</mo><mi>y</mi><mo>&#x00A6;</mo><mi>z</mi>' +1697 '<mo>]</mo></mrow>',1698 '<punctuated>' +1699 '<children>' +1700 '<fenced>' +1701 '<content>' +1702 '<fence>\u2016</fence>' +1703 '<fence>\u2016</fence>' +1704 '</content>' +1705 '<children>' +1706 '<punctuated>' +1707 '<children>' +1708 '<fenced>' +1709 '<content>' +1710 '<fence>[</fence>' +1711 '<fence>]</fence>' +1712 '</content>' +1713 '<children>' +1714 '<punctuated>' +1715 '<children>' +1716 '<identifier>a</identifier>' +1717 '<punctuation>\u2016</punctuation>' +1718 '<identifier>b</identifier>' +1719 '</children>' +1720 '</punctuated>' +1721 '</children>' +1722 '</fenced>' +1723 '<punctuation>|</punctuation>' +1724 '<fenced>' +1725 '<content>' +1726 '<fence>[</fence>' +1727 '<fence>]</fence>' +1728 '</content>' +1729 '<children>' +1730 '<punctuated>' +1731 '<children>' +1732 '<identifier>c</identifier>' +1733 '<punctuation>\u2016</punctuation>' +1734 '<punctuation>\u00A6</punctuation>' +1735 '<identifier>d</identifier>' +1736 '</children>' +1737 '</punctuated>' +1738 '</children>' +1739 '</fenced>' +1740 '</children>' +1741 '</punctuated>' +1742 '</children>' +1743 '</fenced>' +1744 '<punctuation>|</punctuation>' +1745 '<identifier>x</identifier>' +1746 '<punctuation>\u2016</punctuation>' +1747 '<identifier>y</identifier>' +1748 '<punctuation>\u00A6</punctuation>' +1749 '<identifier>z</identifier>' +1750 '<punctuation>]</punctuation>' +1751 '</children>' +1752 '</punctuated>');1753 // Multiple fences, fenced and operations1754 this.executeTreeTest(1755 '<mrow><mo>&#x2016;</mo><mo>]</mo><mo>&#x00A6;</mo><mo>&#x2016;</mo>' +1756 '<mo>[</mo><mo>|</mo><mo>[</mo><mi>a</mi><mo>&#x2016;</mo><mi>b</mi>' +1757 '<mo>]</mo><mo>&#x2016;</mo><mo>|</mo><mi>[</mi><mo>&#x2016;</mo>' +1758 '<mi>y</mi><mo>&#x00A6;</mo><mi>z</mi></mrow>',1759 '<punctuated>' +1760 '<children>' +1761 '<fenced>' +1762 '<content>' +1763 '<fence>\u2016</fence>' +1764 '<fence>\u2016</fence>' +1765 '</content>' +1766 '<children>' +1767 '<punctuated>' +1768 '<children>' +1769 '<punctuation>]</punctuation>' +1770 '<punctuation>\u00A6</punctuation>' +1771 '</children>' +1772 '</punctuated>' +1773 '</children>' +1774 '</fenced>' +1775 '<punctuation>[</punctuation>' +1776 '<fenced>' +1777 '<content>' +1778 '<fence>|</fence>' +1779 '<fence>|</fence>' +1780 '</content>' +1781 '<children>' +1782 '<punctuated>' +1783 '<children>' +1784 '<fenced>' +1785 '<content>' +1786 '<fence>[</fence>' +1787 '<fence>]</fence>' +1788 '</content>' +1789 '<children>' +1790 '<punctuated>' +1791 '<children>' +1792 '<identifier>a</identifier>' +1793 '<punctuation>\u2016</punctuation>' +1794 '<identifier>b</identifier>' +1795 '</children>' +1796 '</punctuated>' +1797 '</children>' +1798 '</fenced>' +1799 '<punctuation>\u2016</punctuation>' +1800 '</children>' +1801 '</punctuated>' +1802 '</children>' +1803 '</fenced>' +1804 '<punctuation>[</punctuation>' +1805 '<punctuation>\u2016</punctuation>' +1806 '<identifier>y</identifier>' +1807 '<punctuation>\u00A6</punctuation>' +1808 '<identifier>z</identifier>' +1809 '</children>' +1810 '</punctuated>');1811 // Multiple fences, fenced and operations1812 this.executeTreeTest(1813 '<mrow><mo>&#x2016;</mo><mo>[</mo><mi>a</mi><mo>&#x00A6;</mo>' +1814 '<mo>&#x2016;</mo><mo>[</mo><mo>+</mo><mo>[</mo><mi>b</mi>' +1815 '<mo>&#x2016;</mo><mi>c</mi><mo>]</mo><mo>+</mo><mo>&#x2016;</mo>' +1816 '<mo>|</mo><mi>d</mi><mo>+</mo><mi>e</mi><mi>[</mi><mo>&#x2016;</mo>' +1817 '<mi>y</mi><mo>&#x00A6;</mo><mo>+</mo><mi>z</mi></mrow>',1818 '<punctuated>' +1819 '<children>' +1820 '<punctuation>\u2016</punctuation>' +1821 '<punctuation>[</punctuation>' +1822 '<identifier>a</identifier>' +1823 '<punctuation>\u00A6</punctuation>' +1824 '<punctuation>\u2016</punctuation>' +1825 '<punctuation>[</punctuation>' +1826 '<postfixop>+' +1827 '<content>' +1828 '<operator>+</operator>' +1829 '</content>' +1830 '<children>' +1831 '<prefixop>+' +1832 '<content>' +1833 '<operator>+</operator>' +1834 '</content>' +1835 '<children>' +1836 '<fenced>' +1837 '<content>' +1838 '<fence>[</fence>' +1839 '<fence>]</fence>' +1840 '</content>' +1841 '<children>' +1842 '<punctuated>' +1843 '<children>' +1844 '<identifier>b</identifier>' +1845 '<punctuation>\u2016</punctuation>' +1846 '<identifier>c</identifier>' +1847 '</children>' +1848 '</punctuated>' +1849 '</children>' +1850 '</fenced>' +1851 '</children>' +1852 '</prefixop>' +1853 '</children>' +1854 '</postfixop>' +1855 '<punctuation>\u2016</punctuation>' +1856 '<punctuation>|</punctuation>' +1857 '<infixop>+' +1858 '<content>' +1859 '<operator>+</operator>' +1860 '</content>' +1861 '<children>' +1862 '<identifier>d</identifier>' +1863 '<identifier>e</identifier>' +1864 '</children>' +1865 '</infixop>' +1866 '<punctuation>[</punctuation>' +1867 '<punctuation>\u2016</punctuation>' +1868 '<identifier>y</identifier>' +1869 '<punctuation>\u00A6</punctuation>' +1870 '<prefixop>+' +1871 '<content>' +1872 '<operator>+</operator>' +1873 '</content>' +1874 '<children>' +1875 '<identifier>z</identifier>' +1876 '</children>' +1877 '</prefixop>' +1878 '</children>' +1879 '</punctuated>');1880 this.xpathBlacklist = [];1881});1882/**1883 * Simple function applications1884 */1885TEST_F('CvoxSemanticTreeUnitTest', 'StreeSimpleFuncsSingle', function() {1886 this.brief = true;1887 this.executeTreeTest(1888 '<mrow><mi>f</mi></mrow>',1889 '<identifier>f</identifier>');1890 this.executeTreeTest(1891 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow>',1892 '<appl>' +1893 '<content>' +1894 '<punctuation>\u2061</punctuation>' +1895 '</content>' +1896 '<children>' +1897 '<identifier>f</identifier>' +1898 '<fenced>' +1899 '<content>' +1900 '<fence>(</fence>' +1901 '<fence>)</fence>' +1902 '</content>' +1903 '<children>' +1904 '<identifier>x</identifier>' +1905 '</children>' +1906 '</fenced>' +1907 '</children>' +1908 '</appl>');1909 this.executeTreeTest(1910 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mi>y</mi><mo>)</mo></mrow>',1911 '<appl>' +1912 '<content>' +1913 '<punctuation>\u2061</punctuation>' +1914 '</content>' +1915 '<children>' +1916 '<identifier>f</identifier>' +1917 '<fenced>' +1918 '<content>' +1919 '<fence>(</fence>' +1920 '<fence>)</fence>' +1921 '</content>' +1922 '<children>' +1923 '<infixop>\u2062' +1924 '<content>' +1925 '<operator>\u2062</operator>' +1926 '</content>' +1927 '<children>' +1928 '<identifier>x</identifier>' +1929 '<identifier>y</identifier>' +1930 '</children>' +1931 '</infixop>' +1932 '</children>' +1933 '</fenced>' +1934 '</children>' +1935 '</appl>');1936 this.executeTreeTest(1937 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>,</mo><mi>y</mi>' +1938 '<mo>,</mo><mi>z</mi><mo>)</mo></mrow>',1939 '<appl>' +1940 '<content>' +1941 '<punctuation>\u2061</punctuation>' +1942 '</content>' +1943 '<children>' +1944 '<identifier>f</identifier>' +1945 '<fenced>' +1946 '<content>' +1947 '<fence>(</fence>' +1948 '<fence>)</fence>' +1949 '</content>' +1950 '<children>' +1951 '<punctuated>' +1952 '<content>' +1953 '<punctuation>,</punctuation>' +1954 '<punctuation>,</punctuation>' +1955 '</content>' +1956 '<children>' +1957 '<identifier>x</identifier>' +1958 '<punctuation>,</punctuation>' +1959 '<identifier>y</identifier>' +1960 '<punctuation>,</punctuation>' +1961 '<identifier>z</identifier>' +1962 '</children>' +1963 '</punctuated>' +1964 '</children>' +1965 '</fenced>' +1966 '</children>' +1967 '</appl>');1968 this.executeTreeTest(1969 '<mrow><mi>f</mi><mo>(</mo><msup><mi>x</mi><mn>2</mn></msup>' +1970 '<mo>)</mo></mrow>',1971 '<appl>' +1972 '<content>' +1973 '<punctuation>\u2061</punctuation>' +1974 '</content>' +1975 '<children>' +1976 '<identifier>f</identifier>' +1977 '<fenced>' +1978 '<content>' +1979 '<fence>(</fence>' +1980 '<fence>)</fence>' +1981 '</content>' +1982 '<children>' +1983 '<superscript>' +1984 '<children>' +1985 '<identifier>x</identifier>' +1986 '<number>2</number>' +1987 '</children>' +1988 '</superscript>' +1989 '</children>' +1990 '</fenced>' +1991 '</children>' +1992 '</appl>');1993 this.executeTreeTest(1994 '<mrow><mi>f</mi><mo>(</mo><msub><mi>x</mi><mn>2</mn></msub>' +1995 '<mo>)</mo></mrow>',1996 '<appl>' +1997 '<content>' +1998 '<punctuation>\u2061</punctuation>' +1999 '</content>' +2000 '<children>' +2001 '<identifier>f</identifier>' +2002 '<fenced>' +2003 '<content>' +2004 '<fence>(</fence>' +2005 '<fence>)</fence>' +2006 '</content>' +2007 '<children>' +2008 '<subscript>' +2009 '<children>' +2010 '<identifier>x</identifier>' +2011 '<number>2</number>' +2012 '</children>' +2013 '</subscript>' +2014 '</children>' +2015 '</fenced>' +2016 '</children>' +2017 '</appl>');2018 this.executeTreeTest(2019 '<mrow><mi>f</mi><mo>(</mo><msubsup><mi>x</mi><mn>2</mn>' +2020 '<mn>1</mn></msubsup><mo>)</mo></mrow>',2021 '<appl>' +2022 '<content>' +2023 '<punctuation>\u2061</punctuation>' +2024 '</content>' +2025 '<children>' +2026 '<identifier>f</identifier>' +2027 '<fenced>' +2028 '<content>' +2029 '<fence>(</fence>' +2030 '<fence>)</fence>' +2031 '</content>' +2032 '<children>' +2033 '<superscript>' +2034 '<children>' +2035 '<subscript>' +2036 '<children>' +2037 '<identifier>x</identifier>' +2038 '<number>2</number>' +2039 '</children>' +2040 '</subscript>' +2041 '<number>1</number>' +2042 '</children>' +2043 '</superscript>' +2044 '</children>' +2045 '</fenced>' +2046 '</children>' +2047 '</appl>');2048 this.executeTreeTest(2049 '<mrow><mi>f</mi><mo>(</mo><mover><mi>x</mi><mn>2</mn></mover>' +2050 '<mo>)</mo></mrow>',2051 '<appl>' +2052 '<content>' +2053 '<punctuation>\u2061</punctuation>' +2054 '</content>' +2055 '<children>' +2056 '<identifier>f</identifier>' +2057 '<fenced>' +2058 '<content>' +2059 '<fence>(</fence>' +2060 '<fence>)</fence>' +2061 '</content>' +2062 '<children>' +2063 '<overscore>' +2064 '<children>' +2065 '<identifier>x</identifier>' +2066 '<number>2</number>' +2067 '</children>' +2068 '</overscore>' +2069 '</children>' +2070 '</fenced>' +2071 '</children>' +2072 '</appl>');2073 this.executeTreeTest(2074 '<mrow><mi>f</mi><mo>(</mo><munder><mi>x</mi><mn>2</mn></munder>' +2075 '<mo>)</mo></mrow>',2076 '<appl>' +2077 '<content>' +2078 '<punctuation>\u2061</punctuation>' +2079 '</content>' +2080 '<children>' +2081 '<identifier>f</identifier>' +2082 '<fenced>' +2083 '<content>' +2084 '<fence>(</fence>' +2085 '<fence>)</fence>' +2086 '</content>' +2087 '<children>' +2088 '<underscore>' +2089 '<children>' +2090 '<identifier>x</identifier>' +2091 '<number>2</number>' +2092 '</children>' +2093 '</underscore>' +2094 '</children>' +2095 '</fenced>' +2096 '</children>' +2097 '</appl>');2098 this.executeTreeTest(2099 '<mrow><mi>f</mi><mo>(</mo><munderover><mi>x</mi><mn>2</mn>' +2100 '<mn>1</mn></munderover><mo>)</mo></mrow>',2101 '<appl>' +2102 '<content>' +2103 '<punctuation>\u2061</punctuation>' +2104 '</content>' +2105 '<children>' +2106 '<identifier>f</identifier>' +2107 '<fenced>' +2108 '<content>' +2109 '<fence>(</fence>' +2110 '<fence>)</fence>' +2111 '</content>' +2112 '<children>' +2113 '<overscore>' +2114 '<children>' +2115 '<underscore>' +2116 '<children>' +2117 '<identifier>x</identifier>' +2118 '<number>2</number>' +2119 '</children>' +2120 '</underscore>' +2121 '<number>1</number>' +2122 '</children>' +2123 '</overscore>' +2124 '</children>' +2125 '</fenced>' +2126 '</children>' +2127 '</appl>');2128 this.executeTreeTest(2129 '<mrow><mi>f</mi><mo>(</mo><mfrac><mn>1</mn><mn>2</mn></mfrac>' +2130 '<mo>)</mo></mrow>',2131 '<appl>' +2132 '<content>' +2133 '<punctuation>\u2061</punctuation>' +2134 '</content>' +2135 '<children>' +2136 '<identifier>f</identifier>' +2137 '<fenced>' +2138 '<content>' +2139 '<fence>(</fence>' +2140 '<fence>)</fence>' +2141 '</content>' +2142 '<children>' +2143 '<fraction>' +2144 '<children>' +2145 '<number>1</number>' +2146 '<number>2</number>' +2147 '</children>' +2148 '</fraction>' +2149 '</children>' +2150 '</fenced>' +2151 '</children>' +2152 '</appl>');2153 this.executeTreeTest(2154 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi>' +2155 '<mo>)</mo></mrow>',2156 '<infixop>\u2062' +2157 '<content>' +2158 '<operator>\u2062</operator>' +2159 '</content>' +2160 '<children>' +2161 '<identifier>f</identifier>' +2162 '<fenced>' +2163 '<content>' +2164 '<fence>(</fence>' +2165 '<fence>)</fence>' +2166 '</content>' +2167 '<children>' +2168 '<infixop>+' +2169 '<content>' +2170 '<operator>+</operator>' +2171 '</content>' +2172 '<children>' +2173 '<identifier>x</identifier>' +2174 '<identifier>y</identifier>' +2175 '</children>' +2176 '</infixop>' +2177 '</children>' +2178 '</fenced>' +2179 '</children>' +2180 '</infixop>');2181});2182/**2183 * Simple functions with surrounding operators.2184 */2185TEST_F('CvoxSemanticTreeUnitTest', 'StreeSimpleFuncsWithOps', function() {2186 this.brief = true;2187 this.executeTreeTest(2188 '<mrow><mn>1</mn><mo>+</mo><mi>f</mi><mo>(</mo><mi>x</mi>' +2189 '<mo>)</mo></mrow>',2190 '<infixop>+' +2191 '<content>' +2192 '<operator>+</operator>' +2193 '</content>' +2194 '<children>' +2195 '<number>1</number>' +2196 '<appl>' +2197 '<content>' +2198 '<punctuation>\u2061</punctuation>' +2199 '</content>' +2200 '<children>' +2201 '<identifier>f</identifier>' +2202 '<fenced>' +2203 '<content>' +2204 '<fence>(</fence>' +2205 '<fence>)</fence>' +2206 '</content>' +2207 '<children>' +2208 '<identifier>x</identifier>' +2209 '</children>' +2210 '</fenced>' +2211 '</children>' +2212 '</appl>' +2213 '</children>' +2214 '</infixop>');2215 this.executeTreeTest(2216 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo>' +2217 '<mn>2</mn></mrow>',2218 '<infixop>+' +2219 '<content>' +2220 '<operator>+</operator>' +2221 '</content>' +2222 '<children>' +2223 '<appl>' +2224 '<content>' +2225 '<punctuation>\u2061</punctuation>' +2226 '</content>' +2227 '<children>' +2228 '<identifier>f</identifier>' +2229 '<fenced>' +2230 '<content>' +2231 '<fence>(</fence>' +2232 '<fence>)</fence>' +2233 '</content>' +2234 '<children>' +2235 '<identifier>x</identifier>' +2236 '</children>' +2237 '</fenced>' +2238 '</children>' +2239 '</appl>' +2240 '<number>2</number>' +2241 '</children>' +2242 '</infixop>');2243 this.executeTreeTest(2244 '<mrow><mn>1</mn><mo>+</mo><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo>' +2245 '<mo>+</mo><mn>2</mn></mrow>',2246 '<infixop>+' +2247 '<content>' +2248 '<operator>+</operator>' +2249 '<operator>+</operator>' +2250 '</content>' +2251 '<children>' +2252 '<number>1</number>' +2253 '<appl>' +2254 '<content>' +2255 '<punctuation>\u2061</punctuation>' +2256 '</content>' +2257 '<children>' +2258 '<identifier>f</identifier>' +2259 '<fenced>' +2260 '<content>' +2261 '<fence>(</fence>' +2262 '<fence>)</fence>' +2263 '</content>' +2264 '<children>' +2265 '<identifier>x</identifier>' +2266 '</children>' +2267 '</fenced>' +2268 '</children>' +2269 '</appl>' +2270 '<number>2</number>' +2271 '</children>' +2272 '</infixop>');2273 this.executeTreeTest(2274 '<mrow><mo>a</mo><mo>+</mo><mi>f</mi><mo>(</mo><mi>x</mi>' +2275 '<mo>)</mo></mrow>',2276 '<infixop>+' +2277 '<content>' +2278 '<operator>+</operator>' +2279 '</content>' +2280 '<children>' +2281 '<identifier>a</identifier>' +2282 '<appl>' +2283 '<content>' +2284 '<punctuation>\u2061</punctuation>' +2285 '</content>' +2286 '<children>' +2287 '<identifier>f</identifier>' +2288 '<fenced>' +2289 '<content>' +2290 '<fence>(</fence>' +2291 '<fence>)</fence>' +2292 '</content>' +2293 '<children>' +2294 '<identifier>x</identifier>' +2295 '</children>' +2296 '</fenced>' +2297 '</children>' +2298 '</appl>' +2299 '</children>' +2300 '</infixop>');2301 this.executeTreeTest(2302 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo>' +2303 '<mo>b</mo></mrow>',2304 '<infixop>+' +2305 '<content>' +2306 '<operator>+</operator>' +2307 '</content>' +2308 '<children>' +2309 '<appl>' +2310 '<content>' +2311 '<punctuation>\u2061</punctuation>' +2312 '</content>' +2313 '<children>' +2314 '<identifier>f</identifier>' +2315 '<fenced>' +2316 '<content>' +2317 '<fence>(</fence>' +2318 '<fence>)</fence>' +2319 '</content>' +2320 '<children>' +2321 '<identifier>x</identifier>' +2322 '</children>' +2323 '</fenced>' +2324 '</children>' +2325 '</appl>' +2326 '<identifier>b</identifier>' +2327 '</children>' +2328 '</infixop>');2329 this.executeTreeTest(2330 '<mrow><mo>a</mo><mo>+</mo><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo>' +2331 '<mo>+</mo><mo>b</mo></mrow>',2332 '<infixop>+' +2333 '<content>' +2334 '<operator>+</operator>' +2335 '<operator>+</operator>' +2336 '</content>' +2337 '<children>' +2338 '<identifier>a</identifier>' +2339 '<appl>' +2340 '<content>' +2341 '<punctuation>\u2061</punctuation>' +2342 '</content>' +2343 '<children>' +2344 '<identifier>f</identifier>' +2345 '<fenced>' +2346 '<content>' +2347 '<fence>(</fence>' +2348 '<fence>)</fence>' +2349 '</content>' +2350 '<children>' +2351 '<identifier>x</identifier>' +2352 '</children>' +2353 '</fenced>' +2354 '</children>' +2355 '</appl>' +2356 '<identifier>b</identifier>' +2357 '</children>' +2358 '</infixop>');2359 this.executeTreeTest(2360 '<mrow><mo>a</mo><mo>=</mo><mi>f</mi><mo>(</mo><mi>x</mi>' +2361 '<mo>)</mo></mrow>',2362 '<relseq>=' +2363 '<content>' +2364 '<relation>=</relation>' +2365 '</content>' +2366 '<children>' +2367 '<identifier>a</identifier>' +2368 '<appl>' +2369 '<content>' +2370 '<punctuation>\u2061</punctuation>' +2371 '</content>' +2372 '<children>' +2373 '<identifier>f</identifier>' +2374 '<fenced>' +2375 '<content>' +2376 '<fence>(</fence>' +2377 '<fence>)</fence>' +2378 '</content>' +2379 '<children>' +2380 '<identifier>x</identifier>' +2381 '</children>' +2382 '</fenced>' +2383 '</children>' +2384 '</appl>' +2385 '</children>' +2386 '</relseq>');2387 this.executeTreeTest(2388 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>=</mo>' +2389 '<mo>b</mo></mrow>',2390 '<relseq>=' +2391 '<content>' +2392 '<relation>=</relation>' +2393 '</content>' +2394 '<children>' +2395 '<appl>' +2396 '<content>' +2397 '<punctuation>\u2061</punctuation>' +2398 '</content>' +2399 '<children>' +2400 '<identifier>f</identifier>' +2401 '<fenced>' +2402 '<content>' +2403 '<fence>(</fence>' +2404 '<fence>)</fence>' +2405 '</content>' +2406 '<children>' +2407 '<identifier>x</identifier>' +2408 '</children>' +2409 '</fenced>' +2410 '</children>' +2411 '</appl>' +2412 '<identifier>b</identifier>' +2413 '</children>' +2414 '</relseq>');2415 this.executeTreeTest(2416 '<mrow><mo>a</mo><mo>=</mo><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo>' +2417 '<mo>=</mo><mo>b</mo></mrow>',2418 '<relseq>=' +2419 '<content>' +2420 '<relation>=</relation>' +2421 '<relation>=</relation>' +2422 '</content>' +2423 '<children>' +2424 '<identifier>a</identifier>' +2425 '<appl>' +2426 '<content>' +2427 '<punctuation>\u2061</punctuation>' +2428 '</content>' +2429 '<children>' +2430 '<identifier>f</identifier>' +2431 '<fenced>' +2432 '<content>' +2433 '<fence>(</fence>' +2434 '<fence>)</fence>' +2435 '</content>' +2436 '<children>' +2437 '<identifier>x</identifier>' +2438 '</children>' +2439 '</fenced>' +2440 '</children>' +2441 '</appl>' +2442 '<identifier>b</identifier>' +2443 '</children>' +2444 '</relseq>');2445});2446/**2447 * Multiple simple functions.2448 */2449TEST_F('CvoxSemanticTreeUnitTest', 'StreeSimpleFuncsMulti', function() {2450 this.brief = true;2451 this.executeTreeTest(2452 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo><mi>g</mi>' +2453 '<mo>(</mo><mi>x</mi><mo>)</mo></mrow>',2454 '<infixop>+' +2455 '<content>' +2456 '<operator>+</operator>' +2457 '</content>' +2458 '<children>' +2459 '<appl>' +2460 '<content>' +2461 '<punctuation>\u2061</punctuation>' +2462 '</content>' +2463 '<children>' +2464 '<identifier>f</identifier>' +2465 '<fenced>' +2466 '<content>' +2467 '<fence>(</fence>' +2468 '<fence>)</fence>' +2469 '</content>' +2470 '<children>' +2471 '<identifier>x</identifier>' +2472 '</children>' +2473 '</fenced>' +2474 '</children>' +2475 '</appl>' +2476 '<appl>' +2477 '<content>' +2478 '<punctuation>\u2061</punctuation>' +2479 '</content>' +2480 '<children>' +2481 '<identifier>g</identifier>' +2482 '<fenced>' +2483 '<content>' +2484 '<fence>(</fence>' +2485 '<fence>)</fence>' +2486 '</content>' +2487 '<children>' +2488 '<identifier>x</identifier>' +2489 '</children>' +2490 '</fenced>' +2491 '</children>' +2492 '</appl>' +2493 '</children>' +2494 '</infixop>');2495 this.executeTreeTest(2496 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo><mi>g</mi>' +2497 '<mo>(</mo><mi>x</mi><mo>)</mo><mo>=</mo><mi>h</mi><mo>(</mo>' +2498 '<mi>x</mi><mo>)</mo></mrow>',2499 '<relseq>=' +2500 '<content>' +2501 '<relation>=</relation>' +2502 '</content>' +2503 '<children>' +2504 '<infixop>+' +2505 '<content>' +2506 '<operator>+</operator>' +2507 '</content>' +2508 '<children>' +2509 '<appl>' +2510 '<content>' +2511 '<punctuation>\u2061</punctuation>' +2512 '</content>' +2513 '<children>' +2514 '<identifier>f</identifier>' +2515 '<fenced>' +2516 '<content>' +2517 '<fence>(</fence>' +2518 '<fence>)</fence>' +2519 '</content>' +2520 '<children>' +2521 '<identifier>x</identifier>' +2522 '</children>' +2523 '</fenced>' +2524 '</children>' +2525 '</appl>' +2526 '<appl>' +2527 '<content>' +2528 '<punctuation>\u2061</punctuation>' +2529 '</content>' +2530 '<children>' +2531 '<identifier>g</identifier>' +2532 '<fenced>' +2533 '<content>' +2534 '<fence>(</fence>' +2535 '<fence>)</fence>' +2536 '</content>' +2537 '<children>' +2538 '<identifier>x</identifier>' +2539 '</children>' +2540 '</fenced>' +2541 '</children>' +2542 '</appl>' +2543 '</children>' +2544 '</infixop>' +2545 '<appl>' +2546 '<content>' +2547 '<punctuation>\u2061</punctuation>' +2548 '</content>' +2549 '<children>' +2550 '<identifier>h</identifier>' +2551 '<fenced>' +2552 '<content>' +2553 '<fence>(</fence>' +2554 '<fence>)</fence>' +2555 '</content>' +2556 '<children>' +2557 '<identifier>x</identifier>' +2558 '</children>' +2559 '</fenced>' +2560 '</children>' +2561 '</appl>' +2562 '</children>' +2563 '</relseq>');2564 this.executeTreeTest(2565 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo><mi>g</mi>' +2566 '<mo>(</mo><mi>y</mi><mo>)</mo><mo>=</mo><mi>h</mi><mo>(</mo>' +2567 '<mi>x</mi><mi>y</mi><mo>)</mo></mrow>',2568 '<relseq>=' +2569 '<content>' +2570 '<relation>=</relation>' +2571 '</content>' +2572 '<children>' +2573 '<infixop>+' +2574 '<content>' +2575 '<operator>+</operator>' +2576 '</content>' +2577 '<children>' +2578 '<appl>' +2579 '<content>' +2580 '<punctuation>\u2061</punctuation>' +2581 '</content>' +2582 '<children>' +2583 '<identifier>f</identifier>' +2584 '<fenced>' +2585 '<content>' +2586 '<fence>(</fence>' +2587 '<fence>)</fence>' +2588 '</content>' +2589 '<children>' +2590 '<identifier>x</identifier>' +2591 '</children>' +2592 '</fenced>' +2593 '</children>' +2594 '</appl>' +2595 '<appl>' +2596 '<content>' +2597 '<punctuation>\u2061</punctuation>' +2598 '</content>' +2599 '<children>' +2600 '<identifier>g</identifier>' +2601 '<fenced>' +2602 '<content>' +2603 '<fence>(</fence>' +2604 '<fence>)</fence>' +2605 '</content>' +2606 '<children>' +2607 '<identifier>y</identifier>' +2608 '</children>' +2609 '</fenced>' +2610 '</children>' +2611 '</appl>' +2612 '</children>' +2613 '</infixop>' +2614 '<appl>' +2615 '<content>' +2616 '<punctuation>\u2061</punctuation>' +2617 '</content>' +2618 '<children>' +2619 '<identifier>h</identifier>' +2620 '<fenced>' +2621 '<content>' +2622 '<fence>(</fence>' +2623 '<fence>)</fence>' +2624 '</content>' +2625 '<children>' +2626 '<infixop>\u2062' +2627 '<content>' +2628 '<operator>\u2062</operator>' +2629 '</content>' +2630 '<children>' +2631 '<identifier>x</identifier>' +2632 '<identifier>y</identifier>' +2633 '</children>' +2634 '</infixop>' +2635 '</children>' +2636 '</fenced>' +2637 '</children>' +2638 '</appl>' +2639 '</children>' +2640 '</relseq>');2641});2642/**2643 * Nested simple functions.2644 */2645TEST_F('CvoxSemanticTreeUnitTest', 'StreeSimpleFuncsNested', function() {2646 this.brief = true;2647 this.executeTreeTest(2648 '<mrow><mi>g</mi><mo>(</mo><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo>' +2649 '<mo>)</mo></mrow>',2650 '<appl>' +2651 '<content>' +2652 '<punctuation>\u2061</punctuation>' +2653 '</content>' +2654 '<children>' +2655 '<identifier>g</identifier>' +2656 '<fenced>' +2657 '<content>' +2658 '<fence>(</fence>' +2659 '<fence>)</fence>' +2660 '</content>' +2661 '<children>' +2662 '<appl>' +2663 '<content>' +2664 '<punctuation>\u2061</punctuation>' +2665 '</content>' +2666 '<children>' +2667 '<identifier>f</identifier>' +2668 '<fenced>' +2669 '<content>' +2670 '<fence>(</fence>' +2671 '<fence>)</fence>' +2672 '</content>' +2673 '<children>' +2674 '<identifier>x</identifier>' +2675 '</children>' +2676 '</fenced>' +2677 '</children>' +2678 '</appl>' +2679 '</children>' +2680 '</fenced>' +2681 '</children>' +2682 '</appl>');2683 this.executeTreeTest(2684 '<mrow><mi>h</mi><mo>(</mo><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo>' +2685 '<mi>g</mi><mo>(</mo><mi>y</mi><mo>)</mo><mo>)</mo></mrow>',2686 '<appl>' +2687 '<content>' +2688 '<punctuation>\u2061</punctuation>' +2689 '</content>' +2690 '<children>' +2691 '<identifier>h</identifier>' +2692 '<fenced>' +2693 '<content>' +2694 '<fence>(</fence>' +2695 '<fence>)</fence>' +2696 '</content>' +2697 '<children>' +2698 '<infixop>\u2062' +2699 '<content>' +2700 '<operator>\u2062</operator>' +2701 '</content>' +2702 '<children>' +2703 '<appl>' +2704 '<content>' +2705 '<punctuation>\u2061</punctuation>' +2706 '</content>' +2707 '<children>' +2708 '<identifier>f</identifier>' +2709 '<fenced>' +2710 '<content>' +2711 '<fence>(</fence>' +2712 '<fence>)</fence>' +2713 '</content>' +2714 '<children>' +2715 '<identifier>x</identifier>' +2716 '</children>' +2717 '</fenced>' +2718 '</children>' +2719 '</appl>' +2720 '<appl>' +2721 '<content>' +2722 '<punctuation>\u2061</punctuation>' +2723 '</content>' +2724 '<children>' +2725 '<identifier>g</identifier>' +2726 '<fenced>' +2727 '<content>' +2728 '<fence>(</fence>' +2729 '<fence>)</fence>' +2730 '</content>' +2731 '<children>' +2732 '<identifier>y</identifier>' +2733 '</children>' +2734 '</fenced>' +2735 '</children>' +2736 '</appl>' +2737 '</children>' +2738 '</infixop>' +2739 '</children>' +2740 '</fenced>' +2741 '</children>' +2742 '</appl>');2743 this.executeTreeTest(2744 '<mrow><mi>h</mi><mo>(</mo><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo>' +2745 '<mo>+</mo><mi>g</mi><mo>(</mo><mi>y</mi><mo>)</mo><mo>)</mo></mrow>',2746 '<infixop>\u2062' +2747 '<content>' +2748 '<operator>\u2062</operator>' +2749 '</content>' +2750 '<children>' +2751 '<identifier>h</identifier>' +2752 '<fenced>' +2753 '<content>' +2754 '<fence>(</fence>' +2755 '<fence>)</fence>' +2756 '</content>' +2757 '<children>' +2758 '<infixop>+' +2759 '<content>' +2760 '<operator>+</operator>' +2761 '</content>' +2762 '<children>' +2763 '<appl>' +2764 '<content>' +2765 '<punctuation>\u2061</punctuation>' +2766 '</content>' +2767 '<children>' +2768 '<identifier>f</identifier>' +2769 '<fenced>' +2770 '<content>' +2771 '<fence>(</fence>' +2772 '<fence>)</fence>' +2773 '</content>' +2774 '<children>' +2775 '<identifier>x</identifier>' +2776 '</children>' +2777 '</fenced>' +2778 '</children>' +2779 '</appl>' +2780 '<appl>' +2781 '<content>' +2782 '<punctuation>\u2061</punctuation>' +2783 '</content>' +2784 '<children>' +2785 '<identifier>g</identifier>' +2786 '<fenced>' +2787 '<content>' +2788 '<fence>(</fence>' +2789 '<fence>)</fence>' +2790 '</content>' +2791 '<children>' +2792 '<identifier>y</identifier>' +2793 '</children>' +2794 '</fenced>' +2795 '</children>' +2796 '</appl>' +2797 '</children>' +2798 '</infixop>' +2799 '</children>' +2800 '</fenced>' +2801 '</children>' +2802 '</infixop>');2803 this.executeTreeTest(2804 '<mi>P</mi><mo>[</mo><mi>x</mi><mo>=</mo><mn>2</mn><mo>]</mo>',2805 '<appl>' +2806 '<content>' +2807 '<punctuation>\u2061</punctuation>' +2808 '</content>' +2809 '<children>' +2810 '<identifier>P</identifier>' +2811 '<fenced>' +2812 '<content>' +2813 '<fence>[</fence>' +2814 '<fence>]</fence>' +2815 '</content>' +2816 '<children>' +2817 '<relseq>=' +2818 '<content>' +2819 '<relation>=</relation>' +2820 '</content>' +2821 '<children>' +2822 '<identifier>x</identifier>' +2823 '<number>2</number>' +2824 '</children>' +2825 '</relseq>' +2826 '</children>' +2827 '</fenced>' +2828 '</children>' +2829 '</appl>');2830});2831/**2832 * Simple functions with explicit function application.2833 */2834TEST_F('CvoxSemanticTreeUnitTest', 'StreeSimpleFuncsExplicitApp', function() {2835 this.brief = true;2836 this.executeTreeTest(2837 '<mi>f</mi><mo>\u2061</mo><mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi>' +2838 '<mo>)</mo>',2839 '<appl>' +2840 '<content>' +2841 '<punctuation>\u2061</punctuation>' +2842 '</content>' +2843 '<children>' +2844 '<identifier>f</identifier>' +2845 '<fenced>' +2846 '<content>' +2847 '<fence>(</fence>' +2848 '<fence>)</fence>' +2849 '</content>' +2850 '<children>' +2851 '<infixop>+' +2852 '<content>' +2853 '<operator>+</operator>' +2854 '</content>' +2855 '<children>' +2856 '<identifier>x</identifier>' +2857 '<identifier>y</identifier>' +2858 '</children>' +2859 '</infixop>' +2860 '</children>' +2861 '</fenced>' +2862 '</children>' +2863 '</appl>');2864 this.executeTreeTest(2865 '<mi>f</mi><mo>\u2061</mo><mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi>' +2866 '<mo>)</mo><mo>+</mo><mi>f</mi><mo>(</mo><mi>x</mi><mo>+</mo>' +2867 '<mi>y</mi><mo>)</mo>',2868 '<infixop>+' +2869 '<content>' +2870 '<operator>+</operator>' +2871 '</content>' +2872 '<children>' +2873 '<appl>' +2874 '<content>' +2875 '<punctuation>\u2061</punctuation>' +2876 '</content>' +2877 '<children>' +2878 '<identifier>f</identifier>' +2879 '<fenced>' +2880 '<content>' +2881 '<fence>(</fence>' +2882 '<fence>)</fence>' +2883 '</content>' +2884 '<children>' +2885 '<infixop>+' +2886 '<content>' +2887 '<operator>+</operator>' +2888 '</content>' +2889 '<children>' +2890 '<identifier>x</identifier>' +2891 '<identifier>y</identifier>' +2892 '</children>' +2893 '</infixop>' +2894 '</children>' +2895 '</fenced>' +2896 '</children>' +2897 '</appl>' +2898 '<infixop>\u2062' +2899 '<content>' +2900 '<operator>\u2062</operator>' +2901 '</content>' +2902 '<children>' +2903 '<identifier>f</identifier>' +2904 '<fenced>' +2905 '<content>' +2906 '<fence>(</fence>' +2907 '<fence>)</fence>' +2908 '</content>' +2909 '<children>' +2910 '<infixop>+' +2911 '<content>' +2912 '<operator>+</operator>' +2913 '</content>' +2914 '<children>' +2915 '<identifier>x</identifier>' +2916 '<identifier>y</identifier>' +2917 '</children>' +2918 '</infixop>' +2919 '</children>' +2920 '</fenced>' +2921 '</children>' +2922 '</infixop>' +2923 '</children>' +2924 '</infixop>');2925 this.executeTreeTest(2926 '<msub><mi>f</mi><mn>1</mn></msub><mo>\u2061</mo><mo>(</mo><mi>x</mi>' +2927 '<mo>+</mo><mi>y</mi><mo>)</mo>',2928 '<appl>' +2929 '<content>' +2930 '<punctuation>\u2061</punctuation>' +2931 '</content>' +2932 '<children>' +2933 '<subscript>' +2934 '<children>' +2935 '<identifier>f</identifier>' +2936 '<number>1</number>' +2937 '</children>' +2938 '</subscript>' +2939 '<fenced>' +2940 '<content>' +2941 '<fence>(</fence>' +2942 '<fence>)</fence>' +2943 '</content>' +2944 '<children>' +2945 '<infixop>+' +2946 '<content>' +2947 '<operator>+</operator>' +2948 '</content>' +2949 '<children>' +2950 '<identifier>x</identifier>' +2951 '<identifier>y</identifier>' +2952 '</children>' +2953 '</infixop>' +2954 '</children>' +2955 '</fenced>' +2956 '</children>' +2957 '</appl>');2958 this.executeTreeTest(2959 '<msup><msub><mi>f</mi><mn>n</mn></msub><mn>2</mn></msup>' +2960 '<mo>\u2061</mo><mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi><mo>)</mo>' +2961 '<mo>+</mo><msup><msub><mi>f</mi><mn>m</mn></msub><mn>2</mn></msup>' +2962 '<mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi><mo>)</mo>',2963 '<infixop>+' +2964 '<content>' +2965 '<operator>+</operator>' +2966 '</content>' +2967 '<children>' +2968 '<appl>' +2969 '<content>' +2970 '<punctuation>\u2061</punctuation>' +2971 '</content>' +2972 '<children>' +2973 '<superscript>' +2974 '<children>' +2975 '<subscript>' +2976 '<children>' +2977 '<identifier>f</identifier>' +2978 '<identifier>n</identifier>' +2979 '</children>' +2980 '</subscript>' +2981 '<number>2</number>' +2982 '</children>' +2983 '</superscript>' +2984 '<fenced>' +2985 '<content>' +2986 '<fence>(</fence>' +2987 '<fence>)</fence>' +2988 '</content>' +2989 '<children>' +2990 '<infixop>+' +2991 '<content>' +2992 '<operator>+</operator>' +2993 '</content>' +2994 '<children>' +2995 '<identifier>x</identifier>' +2996 '<identifier>y</identifier>' +2997 '</children>' +2998 '</infixop>' +2999 '</children>' +3000 '</fenced>' +3001 '</children>' +3002 '</appl>' +3003 '<infixop>\u2062' +3004 '<content>' +3005 '<operator>\u2062</operator>' +3006 '</content>' +3007 '<children>' +3008 '<superscript>' +3009 '<children>' +3010 '<subscript>' +3011 '<children>' +3012 '<identifier>f</identifier>' +3013 '<identifier>m</identifier>' +3014 '</children>' +3015 '</subscript>' +3016 '<number>2</number>' +3017 '</children>' +3018 '</superscript>' +3019 '<fenced>' +3020 '<content>' +3021 '<fence>(</fence>' +3022 '<fence>)</fence>' +3023 '</content>' +3024 '<children>' +3025 '<infixop>+' +3026 '<content>' +3027 '<operator>+</operator>' +3028 '</content>' +3029 '<children>' +3030 '<identifier>x</identifier>' +3031 '<identifier>y</identifier>' +3032 '</children>' +3033 '</infixop>' +3034 '</children>' +3035 '</fenced>' +3036 '</children>' +3037 '</infixop>' +3038 '</children>' +3039 '</infixop>');3040});3041/**3042 * Prefix function applications3043 */3044TEST_F('CvoxSemanticTreeUnitTest', 'StreePrefixFuncsSingle', function() {3045 this.brief = true;3046 this.executeTreeTest(3047 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow>',3048 '<appl>' +3049 '<content>' +3050 '<punctuation>\u2061</punctuation>' +3051 '</content>' +3052 '<children>' +3053 '<function>sin</function>' +3054 '<fenced>' +3055 '<content>' +3056 '<fence>(</fence>' +3057 '<fence>)</fence>' +3058 '</content>' +3059 '<children>' +3060 '<identifier>x</identifier>' +3061 '</children>' +3062 '</fenced>' +3063 '</children>' +3064 '</appl>');3065 this.executeTreeTest(3066 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mi>y</mi><mo>)</mo></mrow>',3067 '<appl>' +3068 '<content>' +3069 '<punctuation>\u2061</punctuation>' +3070 '</content>' +3071 '<children>' +3072 '<function>sin</function>' +3073 '<fenced>' +3074 '<content>' +3075 '<fence>(</fence>' +3076 '<fence>)</fence>' +3077 '</content>' +3078 '<children>' +3079 '<infixop>\u2062' +3080 '<content>' +3081 '<operator>\u2062</operator>' +3082 '</content>' +3083 '<children>' +3084 '<identifier>x</identifier>' +3085 '<identifier>y</identifier>' +3086 '</children>' +3087 '</infixop>' +3088 '</children>' +3089 '</fenced>' +3090 '</children>' +3091 '</appl>');3092 this.executeTreeTest(3093 '<mrow><mi>sin</mi><mo>(</mo><msup><mi>x</mi><mn>2</mn></msup>' +3094 '<mo>)</mo></mrow>',3095 '<appl>' +3096 '<content>' +3097 '<punctuation>\u2061</punctuation>' +3098 '</content>' +3099 '<children>' +3100 '<function>sin</function>' +3101 '<fenced>' +3102 '<content>' +3103 '<fence>(</fence>' +3104 '<fence>)</fence>' +3105 '</content>' +3106 '<children>' +3107 '<superscript>' +3108 '<children>' +3109 '<identifier>x</identifier>' +3110 '<number>2</number>' +3111 '</children>' +3112 '</superscript>' +3113 '</children>' +3114 '</fenced>' +3115 '</children>' +3116 '</appl>');3117 this.executeTreeTest(3118 '<mrow><mi>sin</mi><mo>(</mo><msub><mi>x</mi><mn>2</mn></msub>' +3119 '<mo>)</mo></mrow>',3120 '<appl>' +3121 '<content>' +3122 '<punctuation>\u2061</punctuation>' +3123 '</content>' +3124 '<children>' +3125 '<function>sin</function>' +3126 '<fenced>' +3127 '<content>' +3128 '<fence>(</fence>' +3129 '<fence>)</fence>' +3130 '</content>' +3131 '<children>' +3132 '<subscript>' +3133 '<children>' +3134 '<identifier>x</identifier>' +3135 '<number>2</number>' +3136 '</children>' +3137 '</subscript>' +3138 '</children>' +3139 '</fenced>' +3140 '</children>' +3141 '</appl>');3142 this.executeTreeTest(3143 '<mrow><mi>sin</mi><mo>(</mo><msubsup><mi>x</mi><mn>2</mn>' +3144 '<mn>1</mn></msubsup><mo>)</mo></mrow>',3145 '<appl>' +3146 '<content>' +3147 '<punctuation>\u2061</punctuation>' +3148 '</content>' +3149 '<children>' +3150 '<function>sin</function>' +3151 '<fenced>' +3152 '<content>' +3153 '<fence>(</fence>' +3154 '<fence>)</fence>' +3155 '</content>' +3156 '<children>' +3157 '<superscript>' +3158 '<children>' +3159 '<subscript>' +3160 '<children>' +3161 '<identifier>x</identifier>' +3162 '<number>2</number>' +3163 '</children>' +3164 '</subscript>' +3165 '<number>1</number>' +3166 '</children>' +3167 '</superscript>' +3168 '</children>' +3169 '</fenced>' +3170 '</children>' +3171 '</appl>');3172 this.executeTreeTest(3173 '<mrow><mi>sin</mi><mo>(</mo><mover><mi>x</mi><mn>2</mn></mover>' +3174 '<mo>)</mo></mrow>',3175 '<appl>' +3176 '<content>' +3177 '<punctuation>\u2061</punctuation>' +3178 '</content>' +3179 '<children>' +3180 '<function>sin</function>' +3181 '<fenced>' +3182 '<content>' +3183 '<fence>(</fence>' +3184 '<fence>)</fence>' +3185 '</content>' +3186 '<children>' +3187 '<overscore>' +3188 '<children>' +3189 '<identifier>x</identifier>' +3190 '<number>2</number>' +3191 '</children>' +3192 '</overscore>' +3193 '</children>' +3194 '</fenced>' +3195 '</children>' +3196 '</appl>');3197 this.executeTreeTest(3198 '<mrow><mi>sin</mi><mo>(</mo><munder><mi>x</mi><mn>2</mn></munder>' +3199 '<mo>)</mo></mrow>',3200 '<appl>' +3201 '<content>' +3202 '<punctuation>\u2061</punctuation>' +3203 '</content>' +3204 '<children>' +3205 '<function>sin</function>' +3206 '<fenced>' +3207 '<content>' +3208 '<fence>(</fence>' +3209 '<fence>)</fence>' +3210 '</content>' +3211 '<children>' +3212 '<underscore>' +3213 '<children>' +3214 '<identifier>x</identifier>' +3215 '<number>2</number>' +3216 '</children>' +3217 '</underscore>' +3218 '</children>' +3219 '</fenced>' +3220 '</children>' +3221 '</appl>');3222 this.executeTreeTest(3223 '<mrow><mi>sin</mi><mo>(</mo><munderover><mi>x</mi><mn>2</mn>' +3224 '<mn>1</mn></munderover><mo>)</mo></mrow>',3225 '<appl>' +3226 '<content>' +3227 '<punctuation>\u2061</punctuation>' +3228 '</content>' +3229 '<children>' +3230 '<function>sin</function>' +3231 '<fenced>' +3232 '<content>' +3233 '<fence>(</fence>' +3234 '<fence>)</fence>' +3235 '</content>' +3236 '<children>' +3237 '<overscore>' +3238 '<children>' +3239 '<underscore>' +3240 '<children>' +3241 '<identifier>x</identifier>' +3242 '<number>2</number>' +3243 '</children>' +3244 '</underscore>' +3245 '<number>1</number>' +3246 '</children>' +3247 '</overscore>' +3248 '</children>' +3249 '</fenced>' +3250 '</children>' +3251 '</appl>');3252 this.executeTreeTest(3253 '<mrow><mi>sin</mi><mo>(</mo><mfrac><mn>1</mn><mn>2</mn></mfrac>' +3254 '<mo>)</mo></mrow>',3255 '<appl>' +3256 '<content>' +3257 '<punctuation>\u2061</punctuation>' +3258 '</content>' +3259 '<children>' +3260 '<function>sin</function>' +3261 '<fenced>' +3262 '<content>' +3263 '<fence>(</fence>' +3264 '<fence>)</fence>' +3265 '</content>' +3266 '<children>' +3267 '<fraction>' +3268 '<children>' +3269 '<number>1</number>' +3270 '<number>2</number>' +3271 '</children>' +3272 '</fraction>' +3273 '</children>' +3274 '</fenced>' +3275 '</children>' +3276 '</appl>');3277 this.executeTreeTest(3278 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi>' +3279 '<mo>)</mo></mrow>',3280 '<appl>' +3281 '<content>' +3282 '<punctuation>\u2061</punctuation>' +3283 '</content>' +3284 '<children>' +3285 '<function>sin</function>' +3286 '<fenced>' +3287 '<content>' +3288 '<fence>(</fence>' +3289 '<fence>)</fence>' +3290 '</content>' +3291 '<children>' +3292 '<infixop>+' +3293 '<content>' +3294 '<operator>+</operator>' +3295 '</content>' +3296 '<children>' +3297 '<identifier>x</identifier>' +3298 '<identifier>y</identifier>' +3299 '</children>' +3300 '</infixop>' +3301 '</children>' +3302 '</fenced>' +3303 '</children>' +3304 '</appl>');3305});3306/**3307 * Prefix functions applications with surrounding operators.3308 */3309TEST_F('CvoxSemanticTreeUnitTest', 'StreePrefixFuncsWithOps', function() {3310 this.brief = true;3311 this.executeTreeTest(3312 '<mrow><mn>1</mn><mo>+</mo><mi>sin</mi><mo>(</mo><mi>x</mi>' +3313 '<mo>)</mo></mrow>',3314 '<infixop>+' +3315 '<content>' +3316 '<operator>+</operator>' +3317 '</content>' +3318 '<children>' +3319 '<number>1</number>' +3320 '<appl>' +3321 '<content>' +3322 '<punctuation>\u2061</punctuation>' +3323 '</content>' +3324 '<children>' +3325 '<function>sin</function>' +3326 '<fenced>' +3327 '<content>' +3328 '<fence>(</fence>' +3329 '<fence>)</fence>' +3330 '</content>' +3331 '<children>' +3332 '<identifier>x</identifier>' +3333 '</children>' +3334 '</fenced>' +3335 '</children>' +3336 '</appl>' +3337 '</children>' +3338 '</infixop>');3339 this.executeTreeTest(3340 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo>' +3341 '<mn>2</mn></mrow>',3342 '<infixop>+' +3343 '<content>' +3344 '<operator>+</operator>' +3345 '</content>' +3346 '<children>' +3347 '<appl>' +3348 '<content>' +3349 '<punctuation>\u2061</punctuation>' +3350 '</content>' +3351 '<children>' +3352 '<function>sin</function>' +3353 '<fenced>' +3354 '<content>' +3355 '<fence>(</fence>' +3356 '<fence>)</fence>' +3357 '</content>' +3358 '<children>' +3359 '<identifier>x</identifier>' +3360 '</children>' +3361 '</fenced>' +3362 '</children>' +3363 '</appl>' +3364 '<number>2</number>' +3365 '</children>' +3366 '</infixop>');3367 this.executeTreeTest(3368 '<mrow><mn>1</mn><mo>+</mo><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo>' +3369 '<mo>+</mo><mn>2</mn></mrow>',3370 '<infixop>+' +3371 '<content>' +3372 '<operator>+</operator>' +3373 '<operator>+</operator>' +3374 '</content>' +3375 '<children>' +3376 '<number>1</number>' +3377 '<appl>' +3378 '<content>' +3379 '<punctuation>\u2061</punctuation>' +3380 '</content>' +3381 '<children>' +3382 '<function>sin</function>' +3383 '<fenced>' +3384 '<content>' +3385 '<fence>(</fence>' +3386 '<fence>)</fence>' +3387 '</content>' +3388 '<children>' +3389 '<identifier>x</identifier>' +3390 '</children>' +3391 '</fenced>' +3392 '</children>' +3393 '</appl>' +3394 '<number>2</number>' +3395 '</children>' +3396 '</infixop>');3397 this.executeTreeTest(3398 '<mrow><mo>a</mo><mo>+</mo><mi>sin</mi><mo>(</mo><mi>x</mi>' +3399 '<mo>)</mo></mrow>',3400 '<infixop>+' +3401 '<content>' +3402 '<operator>+</operator>' +3403 '</content>' +3404 '<children>' +3405 '<identifier>a</identifier>' +3406 '<appl>' +3407 '<content>' +3408 '<punctuation>\u2061</punctuation>' +3409 '</content>' +3410 '<children>' +3411 '<function>sin</function>' +3412 '<fenced>' +3413 '<content>' +3414 '<fence>(</fence>' +3415 '<fence>)</fence>' +3416 '</content>' +3417 '<children>' +3418 '<identifier>x</identifier>' +3419 '</children>' +3420 '</fenced>' +3421 '</children>' +3422 '</appl>' +3423 '</children>' +3424 '</infixop>');3425 this.executeTreeTest(3426 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo>' +3427 '<mo>b</mo></mrow>',3428 '<infixop>+' +3429 '<content>' +3430 '<operator>+</operator>' +3431 '</content>' +3432 '<children>' +3433 '<appl>' +3434 '<content>' +3435 '<punctuation>\u2061</punctuation>' +3436 '</content>' +3437 '<children>' +3438 '<function>sin</function>' +3439 '<fenced>' +3440 '<content>' +3441 '<fence>(</fence>' +3442 '<fence>)</fence>' +3443 '</content>' +3444 '<children>' +3445 '<identifier>x</identifier>' +3446 '</children>' +3447 '</fenced>' +3448 '</children>' +3449 '</appl>' +3450 '<identifier>b</identifier>' +3451 '</children>' +3452 '</infixop>');3453 this.executeTreeTest(3454 '<mrow><mo>a</mo><mo>+</mo><mi>sin</mi><mo>(</mo><mi>x</mi>' +3455 '<mo>)</mo><mo>+</mo><mo>b</mo></mrow>',3456 '<infixop>+' +3457 '<content>' +3458 '<operator>+</operator>' +3459 '<operator>+</operator>' +3460 '</content>' +3461 '<children>' +3462 '<identifier>a</identifier>' +3463 '<appl>' +3464 '<content>' +3465 '<punctuation>\u2061</punctuation>' +3466 '</content>' +3467 '<children>' +3468 '<function>sin</function>' +3469 '<fenced>' +3470 '<content>' +3471 '<fence>(</fence>' +3472 '<fence>)</fence>' +3473 '</content>' +3474 '<children>' +3475 '<identifier>x</identifier>' +3476 '</children>' +3477 '</fenced>' +3478 '</children>' +3479 '</appl>' +3480 '<identifier>b</identifier>' +3481 '</children>' +3482 '</infixop>');3483 this.executeTreeTest(3484 '<mrow><mo>a</mo><mo>=</mo><mi>sin</mi><mo>(</mo><mi>x</mi>' +3485 '<mo>)</mo></mrow>',3486 '<relseq>=' +3487 '<content>' +3488 '<relation>=</relation>' +3489 '</content>' +3490 '<children>' +3491 '<identifier>a</identifier>' +3492 '<appl>' +3493 '<content>' +3494 '<punctuation>\u2061</punctuation>' +3495 '</content>' +3496 '<children>' +3497 '<function>sin</function>' +3498 '<fenced>' +3499 '<content>' +3500 '<fence>(</fence>' +3501 '<fence>)</fence>' +3502 '</content>' +3503 '<children>' +3504 '<identifier>x</identifier>' +3505 '</children>' +3506 '</fenced>' +3507 '</children>' +3508 '</appl>' +3509 '</children>' +3510 '</relseq>');3511 this.executeTreeTest(3512 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>=</mo>' +3513 '<mo>b</mo></mrow>',3514 '<relseq>=' +3515 '<content>' +3516 '<relation>=</relation>' +3517 '</content>' +3518 '<children>' +3519 '<appl>' +3520 '<content>' +3521 '<punctuation>\u2061</punctuation>' +3522 '</content>' +3523 '<children>' +3524 '<function>sin</function>' +3525 '<fenced>' +3526 '<content>' +3527 '<fence>(</fence>' +3528 '<fence>)</fence>' +3529 '</content>' +3530 '<children>' +3531 '<identifier>x</identifier>' +3532 '</children>' +3533 '</fenced>' +3534 '</children>' +3535 '</appl>' +3536 '<identifier>b</identifier>' +3537 '</children>' +3538 '</relseq>');3539 this.executeTreeTest(3540 '<mrow><mo>a</mo><mo>=</mo><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo>' +3541 '<mo>=</mo><mo>b</mo></mrow>',3542 '<relseq>=' +3543 '<content>' +3544 '<relation>=</relation>' +3545 '<relation>=</relation>' +3546 '</content>' +3547 '<children>' +3548 '<identifier>a</identifier>' +3549 '<appl>' +3550 '<content>' +3551 '<punctuation>\u2061</punctuation>' +3552 '</content>' +3553 '<children>' +3554 '<function>sin</function>' +3555 '<fenced>' +3556 '<content>' +3557 '<fence>(</fence>' +3558 '<fence>)</fence>' +3559 '</content>' +3560 '<children>' +3561 '<identifier>x</identifier>' +3562 '</children>' +3563 '</fenced>' +3564 '</children>' +3565 '</appl>' +3566 '<identifier>b</identifier>' +3567 '</children>' +3568 '</relseq>');3569});3570/**3571 * Multiple prefix function applications.3572 */3573TEST_F('CvoxSemanticTreeUnitTest', 'StreePrefixFuncsMulti', function() {3574 this.brief = true;3575 this.executeTreeTest(3576 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo><mi>cos</mi>' +3577 '<mo>(</mo><mi>x</mi><mo>)</mo></mrow>',3578 '<infixop>+' +3579 '<content>' +3580 '<operator>+</operator>' +3581 '</content>' +3582 '<children>' +3583 '<appl>' +3584 '<content>' +3585 '<punctuation>\u2061</punctuation>' +3586 '</content>' +3587 '<children>' +3588 '<function>sin</function>' +3589 '<fenced>' +3590 '<content>' +3591 '<fence>(</fence>' +3592 '<fence>)</fence>' +3593 '</content>' +3594 '<children>' +3595 '<identifier>x</identifier>' +3596 '</children>' +3597 '</fenced>' +3598 '</children>' +3599 '</appl>' +3600 '<appl>' +3601 '<content>' +3602 '<punctuation>\u2061</punctuation>' +3603 '</content>' +3604 '<children>' +3605 '<function>cos</function>' +3606 '<fenced>' +3607 '<content>' +3608 '<fence>(</fence>' +3609 '<fence>)</fence>' +3610 '</content>' +3611 '<children>' +3612 '<identifier>x</identifier>' +3613 '</children>' +3614 '</fenced>' +3615 '</children>' +3616 '</appl>' +3617 '</children>' +3618 '</infixop>');3619 this.executeTreeTest(3620 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo><mi>cos</mi>' +3621 '<mo>(</mo><mi>x</mi><mo>)</mo><mo>=</mo><mi>tan</mi><mo>(</mo>' +3622 '<mi>x</mi><mo>)</mo></mrow>',3623 '<relseq>=' +3624 '<content>' +3625 '<relation>=</relation>' +3626 '</content>' +3627 '<children>' +3628 '<infixop>+' +3629 '<content>' +3630 '<operator>+</operator>' +3631 '</content>' +3632 '<children>' +3633 '<appl>' +3634 '<content>' +3635 '<punctuation>\u2061</punctuation>' +3636 '</content>' +3637 '<children>' +3638 '<function>sin</function>' +3639 '<fenced>' +3640 '<content>' +3641 '<fence>(</fence>' +3642 '<fence>)</fence>' +3643 '</content>' +3644 '<children>' +3645 '<identifier>x</identifier>' +3646 '</children>' +3647 '</fenced>' +3648 '</children>' +3649 '</appl>' +3650 '<appl>' +3651 '<content>' +3652 '<punctuation>\u2061</punctuation>' +3653 '</content>' +3654 '<children>' +3655 '<function>cos</function>' +3656 '<fenced>' +3657 '<content>' +3658 '<fence>(</fence>' +3659 '<fence>)</fence>' +3660 '</content>' +3661 '<children>' +3662 '<identifier>x</identifier>' +3663 '</children>' +3664 '</fenced>' +3665 '</children>' +3666 '</appl>' +3667 '</children>' +3668 '</infixop>' +3669 '<appl>' +3670 '<content>' +3671 '<punctuation>\u2061</punctuation>' +3672 '</content>' +3673 '<children>' +3674 '<function>tan</function>' +3675 '<fenced>' +3676 '<content>' +3677 '<fence>(</fence>' +3678 '<fence>)</fence>' +3679 '</content>' +3680 '<children>' +3681 '<identifier>x</identifier>' +3682 '</children>' +3683 '</fenced>' +3684 '</children>' +3685 '</appl>' +3686 '</children>' +3687 '</relseq>');3688 this.executeTreeTest(3689 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo><mi>cos</mi>' +3690 '<mo>(</mo><mi>y</mi><mo>)</mo><mo>=</mo><mi>tan</mi><mo>(</mo>' +3691 '<mi>x</mi><mi>y</mi><mo>)</mo></mrow>',3692 '<relseq>=' +3693 '<content>' +3694 '<relation>=</relation>' +3695 '</content>' +3696 '<children>' +3697 '<infixop>+' +3698 '<content>' +3699 '<operator>+</operator>' +3700 '</content>' +3701 '<children>' +3702 '<appl>' +3703 '<content>' +3704 '<punctuation>\u2061</punctuation>' +3705 '</content>' +3706 '<children>' +3707 '<function>sin</function>' +3708 '<fenced>' +3709 '<content>' +3710 '<fence>(</fence>' +3711 '<fence>)</fence>' +3712 '</content>' +3713 '<children>' +3714 '<identifier>x</identifier>' +3715 '</children>' +3716 '</fenced>' +3717 '</children>' +3718 '</appl>' +3719 '<appl>' +3720 '<content>' +3721 '<punctuation>\u2061</punctuation>' +3722 '</content>' +3723 '<children>' +3724 '<function>cos</function>' +3725 '<fenced>' +3726 '<content>' +3727 '<fence>(</fence>' +3728 '<fence>)</fence>' +3729 '</content>' +3730 '<children>' +3731 '<identifier>y</identifier>' +3732 '</children>' +3733 '</fenced>' +3734 '</children>' +3735 '</appl>' +3736 '</children>' +3737 '</infixop>' +3738 '<appl>' +3739 '<content>' +3740 '<punctuation>\u2061</punctuation>' +3741 '</content>' +3742 '<children>' +3743 '<function>tan</function>' +3744 '<fenced>' +3745 '<content>' +3746 '<fence>(</fence>' +3747 '<fence>)</fence>' +3748 '</content>' +3749 '<children>' +3750 '<infixop>\u2062' +3751 '<content>' +3752 '<operator>\u2062</operator>' +3753 '</content>' +3754 '<children>' +3755 '<identifier>x</identifier>' +3756 '<identifier>y</identifier>' +3757 '</children>' +3758 '</infixop>' +3759 '</children>' +3760 '</fenced>' +3761 '</children>' +3762 '</appl>' +3763 '</children>' +3764 '</relseq>');3765});3766/**3767 * Prefix function applications with sub- and superscripts.3768 */3769TEST_F('CvoxSemanticTreeUnitTest', 'StreePrefixFuncsScripts', function() {3770 this.brief = true;3771 this.executeTreeTest(3772 '<mrow><msup><mi>sin</mi><mn>2</mn></msup><mo>(</mo><mi>x</mi>' +3773 '<mo>)</mo></mrow>',3774 '<appl>' +3775 '<content>' +3776 '<punctuation>\u2061</punctuation>' +3777 '</content>' +3778 '<children>' +3779 '<superscript>' +3780 '<children>' +3781 '<function>sin</function>' +3782 '<number>2</number>' +3783 '</children>' +3784 '</superscript>' +3785 '<fenced>' +3786 '<content>' +3787 '<fence>(</fence>' +3788 '<fence>)</fence>' +3789 '</content>' +3790 '<children>' +3791 '<identifier>x</identifier>' +3792 '</children>' +3793 '</fenced>' +3794 '</children>' +3795 '</appl>');3796 this.executeTreeTest(3797 '<mrow><msub><mi>sin</mi><mn>1</mn></msub><mo>(</mo><mi>x</mi>' +3798 '<mo>)</mo></mrow>',3799 '<appl>' +3800 '<content>' +3801 '<punctuation>\u2061</punctuation>' +3802 '</content>' +3803 '<children>' +3804 '<subscript>' +3805 '<children>' +3806 '<function>sin</function>' +3807 '<number>1</number>' +3808 '</children>' +3809 '</subscript>' +3810 '<fenced>' +3811 '<content>' +3812 '<fence>(</fence>' +3813 '<fence>)</fence>' +3814 '</content>' +3815 '<children>' +3816 '<identifier>x</identifier>' +3817 '</children>' +3818 '</fenced>' +3819 '</children>' +3820 '</appl>');3821 this.executeTreeTest(3822 '<mrow><msubsup><mi>sin</mi><mn>2</mn><mn>1</mn></msubsup><mo>(</mo>' +3823 '<mi>x</mi><mo>)</mo></mrow>',3824 '<appl>' +3825 '<content>' +3826 '<punctuation>\u2061</punctuation>' +3827 '</content>' +3828 '<children>' +3829 '<superscript>' +3830 '<children>' +3831 '<subscript>' +3832 '<children>' +3833 '<function>sin</function>' +3834 '<number>2</number>' +3835 '</children>' +3836 '</subscript>' +3837 '<number>1</number>' +3838 '</children>' +3839 '</superscript>' +3840 '<fenced>' +3841 '<content>' +3842 '<fence>(</fence>' +3843 '<fence>)</fence>' +3844 '</content>' +3845 '<children>' +3846 '<identifier>x</identifier>' +3847 '</children>' +3848 '</fenced>' +3849 '</children>' +3850 '</appl>');3851 this.executeTreeTest(3852 '<mrow><msup><mi>sin</mi><mn>2</mn></msup><mo>(</mo><mi>x</mi>' +3853 '<mo>)</mo><mo>+</mo><msup><mi>cos</mi><mn>2</mn></msup><mo>(</mo>' +3854 '<mi>y</mi><mo>)</mo><mo>=</mo><mn>1</mn></mrow>',3855 '<relseq>=' +3856 '<content>' +3857 '<relation>=</relation>' +3858 '</content>' +3859 '<children>' +3860 '<infixop>+' +3861 '<content>' +3862 '<operator>+</operator>' +3863 '</content>' +3864 '<children>' +3865 '<appl>' +3866 '<content>' +3867 '<punctuation>\u2061</punctuation>' +3868 '</content>' +3869 '<children>' +3870 '<superscript>' +3871 '<children>' +3872 '<function>sin</function>' +3873 '<number>2</number>' +3874 '</children>' +3875 '</superscript>' +3876 '<fenced>' +3877 '<content>' +3878 '<fence>(</fence>' +3879 '<fence>)</fence>' +3880 '</content>' +3881 '<children>' +3882 '<identifier>x</identifier>' +3883 '</children>' +3884 '</fenced>' +3885 '</children>' +3886 '</appl>' +3887 '<appl>' +3888 '<content>' +3889 '<punctuation>\u2061</punctuation>' +3890 '</content>' +3891 '<children>' +3892 '<superscript>' +3893 '<children>' +3894 '<function>cos</function>' +3895 '<number>2</number>' +3896 '</children>' +3897 '</superscript>' +3898 '<fenced>' +3899 '<content>' +3900 '<fence>(</fence>' +3901 '<fence>)</fence>' +3902 '</content>' +3903 '<children>' +3904 '<identifier>y</identifier>' +3905 '</children>' +3906 '</fenced>' +3907 '</children>' +3908 '</appl>' +3909 '</children>' +3910 '</infixop>' +3911 '<number>1</number>' +3912 '</children>' +3913 '</relseq>');3914});3915/**3916 * Prefix function applications with unfenced arguments.3917 */3918TEST_F('CvoxSemanticTreeUnitTest', 'StreePrefixFuncsUnfenced', function() {3919 this.brief = true;3920 this.executeTreeTest(3921 '<mrow><mi>sin</mi><mi>x</mi></mrow>',3922 '<appl>' +3923 '<content>' +3924 '<punctuation>\u2061</punctuation>' +3925 '</content>' +3926 '<children>' +3927 '<function>sin</function>' +3928 '<identifier>x</identifier>' +3929 '</children>' +3930 '</appl>');3931 this.executeTreeTest(3932 '<mrow><mi>sin</mi><mi>x</mi><mi>y</mi></mrow>',3933 '<appl>' +3934 '<content>' +3935 '<punctuation>\u2061</punctuation>' +3936 '</content>' +3937 '<children>' +3938 '<function>sin</function>' +3939 '<infixop>\u2062' +3940 '<content>' +3941 '<operator>\u2062</operator>' +3942 '</content>' +3943 '<children>' +3944 '<identifier>x</identifier>' +3945 '<identifier>y</identifier>' +3946 '</children>' +3947 '</infixop>' +3948 '</children>' +3949 '</appl>');3950 this.executeTreeTest(3951 '<mrow><mi>sin</mi><msup><mi>x</mi><mn>2</mn></msup></mrow>',3952 '<appl>' +3953 '<content>' +3954 '<punctuation>\u2061</punctuation>' +3955 '</content>' +3956 '<children>' +3957 '<function>sin</function>' +3958 '<superscript>' +3959 '<children>' +3960 '<identifier>x</identifier>' +3961 '<number>2</number>' +3962 '</children>' +3963 '</superscript>' +3964 '</children>' +3965 '</appl>');3966 this.executeTreeTest(3967 '<mrow><mi>sin</mi><msub><mi>x</mi><mn>2</mn></msub></mrow>',3968 '<appl>' +3969 '<content>' +3970 '<punctuation>\u2061</punctuation>' +3971 '</content>' +3972 '<children>' +3973 '<function>sin</function>' +3974 '<subscript>' +3975 '<children>' +3976 '<identifier>x</identifier>' +3977 '<number>2</number>' +3978 '</children>' +3979 '</subscript>' +3980 '</children>' +3981 '</appl>');3982 this.executeTreeTest(3983 '<mrow><mi>sin</mi><msubsup><mi>x</mi><mn>2</mn><mn>1</mn>' +3984 '</msubsup></mrow>',3985 '<appl>' +3986 '<content>' +3987 '<punctuation>\u2061</punctuation>' +3988 '</content>' +3989 '<children>' +3990 '<function>sin</function>' +3991 '<superscript>' +3992 '<children>' +3993 '<subscript>' +3994 '<children>' +3995 '<identifier>x</identifier>' +3996 '<number>2</number>' +3997 '</children>' +3998 '</subscript>' +3999 '<number>1</number>' +4000 '</children>' +4001 '</superscript>' +4002 '</children>' +4003 '</appl>');4004 this.executeTreeTest(4005 '<mrow><mi>sin</mi><mover><mi>x</mi><mn>2</mn></mover></mrow>',4006 '<appl>' +4007 '<content>' +4008 '<punctuation>\u2061</punctuation>' +4009 '</content>' +4010 '<children>' +4011 '<function>sin</function>' +4012 '<overscore>' +4013 '<children>' +4014 '<identifier>x</identifier>' +4015 '<number>2</number>' +4016 '</children>' +4017 '</overscore>' +4018 '</children>' +4019 '</appl>');4020 this.executeTreeTest(4021 '<mrow><mi>sin</mi><munder><mi>x</mi><mn>2</mn></munder></mrow>',4022 '<appl>' +4023 '<content>' +4024 '<punctuation>\u2061</punctuation>' +4025 '</content>' +4026 '<children>' +4027 '<function>sin</function>' +4028 '<underscore>' +4029 '<children>' +4030 '<identifier>x</identifier>' +4031 '<number>2</number>' +4032 '</children>' +4033 '</underscore>' +4034 '</children>' +4035 '</appl>');4036 this.executeTreeTest(4037 '<mrow><mi>sin</mi><munderover><mi>x</mi><mn>2</mn><mn>1</mn>' +4038 '</munderover></mrow>',4039 '<appl>' +4040 '<content>' +4041 '<punctuation>\u2061</punctuation>' +4042 '</content>' +4043 '<children>' +4044 '<function>sin</function>' +4045 '<overscore>' +4046 '<children>' +4047 '<underscore>' +4048 '<children>' +4049 '<identifier>x</identifier>' +4050 '<number>2</number>' +4051 '</children>' +4052 '</underscore>' +4053 '<number>1</number>' +4054 '</children>' +4055 '</overscore>' +4056 '</children>' +4057 '</appl>');4058 this.executeTreeTest(4059 '<mrow><mi>sin</mi><mfrac><mn>1</mn><mn>2</mn></mfrac></mrow>',4060 '<appl>' +4061 '<content>' +4062 '<punctuation>\u2061</punctuation>' +4063 '</content>' +4064 '<children>' +4065 '<function>sin</function>' +4066 '<fraction>' +4067 '<children>' +4068 '<number>1</number>' +4069 '<number>2</number>' +4070 '</children>' +4071 '</fraction>' +4072 '</children>' +4073 '</appl>');4074});4075/**4076 * Prefix function applications with unfenced arguments in an operator4077 * expression.4078 */4079TEST_F('CvoxSemanticTreeUnitTest', 'StreePrefixFuncsUnfencedOps', function() {4080 this.brief = true;4081 this.executeTreeTest(4082 '<mrow><mn>1</mn><mo>+</mo><mi>sin</mi><mi>x</mi></mrow>',4083 '<infixop>+' +4084 '<content>' +4085 '<operator>+</operator>' +4086 '</content>' +4087 '<children>' +4088 '<number>1</number>' +4089 '<appl>' +4090 '<content>' +4091 '<punctuation>\u2061</punctuation>' +4092 '</content>' +4093 '<children>' +4094 '<function>sin</function>' +4095 '<identifier>x</identifier>' +4096 '</children>' +4097 '</appl>' +4098 '</children>' +4099 '</infixop>');4100 this.executeTreeTest(4101 '<mrow><mi>sin</mi><mi>x</mi><mo>+</mo><mn>2</mn></mrow>',4102 '<infixop>+' +4103 '<content>' +4104 '<operator>+</operator>' +4105 '</content>' +4106 '<children>' +4107 '<appl>' +4108 '<content>' +4109 '<punctuation>\u2061</punctuation>' +4110 '</content>' +4111 '<children>' +4112 '<function>sin</function>' +4113 '<identifier>x</identifier>' +4114 '</children>' +4115 '</appl>' +4116 '<number>2</number>' +4117 '</children>' +4118 '</infixop>');4119 this.executeTreeTest(4120 '<mrow><mn>1</mn><mo>+</mo><mi>sin</mi><mi>x</mi><mo>+</mo>' +4121 '<mn>2</mn></mrow>',4122 '<infixop>+' +4123 '<content>' +4124 '<operator>+</operator>' +4125 '<operator>+</operator>' +4126 '</content>' +4127 '<children>' +4128 '<number>1</number>' +4129 '<appl>' +4130 '<content>' +4131 '<punctuation>\u2061</punctuation>' +4132 '</content>' +4133 '<children>' +4134 '<function>sin</function>' +4135 '<identifier>x</identifier>' +4136 '</children>' +4137 '</appl>' +4138 '<number>2</number>' +4139 '</children>' +4140 '</infixop>');4141 this.executeTreeTest(4142 '<mrow><mo>a</mo><mo>+</mo><mi>sin</mi><mi>x</mi></mrow>',4143 '<infixop>+' +4144 '<content>' +4145 '<operator>+</operator>' +4146 '</content>' +4147 '<children>' +4148 '<identifier>a</identifier>' +4149 '<appl>' +4150 '<content>' +4151 '<punctuation>\u2061</punctuation>' +4152 '</content>' +4153 '<children>' +4154 '<function>sin</function>' +4155 '<identifier>x</identifier>' +4156 '</children>' +4157 '</appl>' +4158 '</children>' +4159 '</infixop>');4160 this.executeTreeTest(4161 '<mrow><mi>sin</mi><mi>x</mi><mo>+</mo><mo>b</mo></mrow>',4162 '<infixop>+' +4163 '<content>' +4164 '<operator>+</operator>' +4165 '</content>' +4166 '<children>' +4167 '<appl>' +4168 '<content>' +4169 '<punctuation>\u2061</punctuation>' +4170 '</content>' +4171 '<children>' +4172 '<function>sin</function>' +4173 '<identifier>x</identifier>' +4174 '</children>' +4175 '</appl>' +4176 '<identifier>b</identifier>' +4177 '</children>' +4178 '</infixop>');4179 this.executeTreeTest(4180 '<mrow><mo>a</mo><mo>+</mo><mi>sin</mi><mi>x</mi><mo>+</mo>' +4181 '<mo>b</mo></mrow>',4182 '<infixop>+' +4183 '<content>' +4184 '<operator>+</operator>' +4185 '<operator>+</operator>' +4186 '</content>' +4187 '<children>' +4188 '<identifier>a</identifier>' +4189 '<appl>' +4190 '<content>' +4191 '<punctuation>\u2061</punctuation>' +4192 '</content>' +4193 '<children>' +4194 '<function>sin</function>' +4195 '<identifier>x</identifier>' +4196 '</children>' +4197 '</appl>' +4198 '<identifier>b</identifier>' +4199 '</children>' +4200 '</infixop>');4201 this.executeTreeTest(4202 '<mrow><mo>a</mo><mo>=</mo><mi>sin</mi><mi>x</mi></mrow>',4203 '<relseq>=' +4204 '<content>' +4205 '<relation>=</relation>' +4206 '</content>' +4207 '<children>' +4208 '<identifier>a</identifier>' +4209 '<appl>' +4210 '<content>' +4211 '<punctuation>\u2061</punctuation>' +4212 '</content>' +4213 '<children>' +4214 '<function>sin</function>' +4215 '<identifier>x</identifier>' +4216 '</children>' +4217 '</appl>' +4218 '</children>' +4219 '</relseq>');4220 this.executeTreeTest(4221 '<mrow><mi>sin</mi><mi>x</mi><mo>=</mo><mo>b</mo></mrow>',4222 '<relseq>=' +4223 '<content>' +4224 '<relation>=</relation>' +4225 '</content>' +4226 '<children>' +4227 '<appl>' +4228 '<content>' +4229 '<punctuation>\u2061</punctuation>' +4230 '</content>' +4231 '<children>' +4232 '<function>sin</function>' +4233 '<identifier>x</identifier>' +4234 '</children>' +4235 '</appl>' +4236 '<identifier>b</identifier>' +4237 '</children>' +4238 '</relseq>');4239 this.executeTreeTest(4240 '<mrow><mo>a</mo><mo>=</mo><mi>sin</mi><mi>x</mi><mo>=</mo>' +4241 '<mo>b</mo></mrow>',4242 '<relseq>=' +4243 '<content>' +4244 '<relation>=</relation>' +4245 '<relation>=</relation>' +4246 '</content>' +4247 '<children>' +4248 '<identifier>a</identifier>' +4249 '<appl>' +4250 '<content>' +4251 '<punctuation>\u2061</punctuation>' +4252 '</content>' +4253 '<children>' +4254 '<function>sin</function>' +4255 '<identifier>x</identifier>' +4256 '</children>' +4257 '</appl>' +4258 '<identifier>b</identifier>' +4259 '</children>' +4260 '</relseq>');4261});4262/**4263 * Multiple prefix function applications with unfenced arguments.4264 */4265TEST_F('CvoxSemanticTreeUnitTest', 'StreePrefixFuncsMultiUnfenced', function() {4266 this.brief = true;4267 this.executeTreeTest(4268 '<mrow><mi>sin</mi><mi>x</mi><mo>+</mo><mi>cos</mi><mi>x</mi></mrow>',4269 '<infixop>+' +4270 '<content>' +4271 '<operator>+</operator>' +4272 '</content>' +4273 '<children>' +4274 '<appl>' +4275 '<content>' +4276 '<punctuation>\u2061</punctuation>' +4277 '</content>' +4278 '<children>' +4279 '<function>sin</function>' +4280 '<identifier>x</identifier>' +4281 '</children>' +4282 '</appl>' +4283 '<appl>' +4284 '<content>' +4285 '<punctuation>\u2061</punctuation>' +4286 '</content>' +4287 '<children>' +4288 '<function>cos</function>' +4289 '<identifier>x</identifier>' +4290 '</children>' +4291 '</appl>' +4292 '</children>' +4293 '</infixop>');4294 this.executeTreeTest(4295 '<mrow><mi>sin</mi><mi>x</mi><mo>+</mo><mi>cos</mi><mi>x</mi><mo>=</mo>' +4296 '<mi>tan</mi><mi>x</mi></mrow>',4297 '<relseq>=' +4298 '<content>' +4299 '<relation>=</relation>' +4300 '</content>' +4301 '<children>' +4302 '<infixop>+' +4303 '<content>' +4304 '<operator>+</operator>' +4305 '</content>' +4306 '<children>' +4307 '<appl>' +4308 '<content>' +4309 '<punctuation>\u2061</punctuation>' +4310 '</content>' +4311 '<children>' +4312 '<function>sin</function>' +4313 '<identifier>x</identifier>' +4314 '</children>' +4315 '</appl>' +4316 '<appl>' +4317 '<content>' +4318 '<punctuation>\u2061</punctuation>' +4319 '</content>' +4320 '<children>' +4321 '<function>cos</function>' +4322 '<identifier>x</identifier>' +4323 '</children>' +4324 '</appl>' +4325 '</children>' +4326 '</infixop>' +4327 '<appl>' +4328 '<content>' +4329 '<punctuation>\u2061</punctuation>' +4330 '</content>' +4331 '<children>' +4332 '<function>tan</function>' +4333 '<identifier>x</identifier>' +4334 '</children>' +4335 '</appl>' +4336 '</children>' +4337 '</relseq>');4338 this.executeTreeTest(4339 '<mrow><mi>sin</mi><mi>x</mi><mo>+</mo><mi>cos</mi><mi>y</mi><mo>=</mo>' +4340 '<mi>tan</mi><mi>x</mi><mi>y</mi></mrow>',4341 '<relseq>=' +4342 '<content>' +4343 '<relation>=</relation>' +4344 '</content>' +4345 '<children>' +4346 '<infixop>+' +4347 '<content>' +4348 '<operator>+</operator>' +4349 '</content>' +4350 '<children>' +4351 '<appl>' +4352 '<content>' +4353 '<punctuation>\u2061</punctuation>' +4354 '</content>' +4355 '<children>' +4356 '<function>sin</function>' +4357 '<identifier>x</identifier>' +4358 '</children>' +4359 '</appl>' +4360 '<appl>' +4361 '<content>' +4362 '<punctuation>\u2061</punctuation>' +4363 '</content>' +4364 '<children>' +4365 '<function>cos</function>' +4366 '<identifier>y</identifier>' +4367 '</children>' +4368 '</appl>' +4369 '</children>' +4370 '</infixop>' +4371 '<appl>' +4372 '<content>' +4373 '<punctuation>\u2061</punctuation>' +4374 '</content>' +4375 '<children>' +4376 '<function>tan</function>' +4377 '<infixop>\u2062' +4378 '<content>' +4379 '<operator>\u2062</operator>' +4380 '</content>' +4381 '<children>' +4382 '<identifier>x</identifier>' +4383 '<identifier>y</identifier>' +4384 '</children>' +4385 '</infixop>' +4386 '</children>' +4387 '</appl>' +4388 '</children>' +4389 '</relseq>');4390});4391/**4392 * Prefix function applications with sub- and superscripts and unfenced4393 * arguments.4394 */4395TEST_F('CvoxSemanticTreeUnitTest', 'StreePrefixFuncsScriptUnfenced',4396 function() {4397 this.brief = true;4398 this.executeTreeTest(4399 '<mrow><msup><mi>sin</mi><mn>2</mn></msup><mi>x</mi></mrow>',4400 '<appl>' +4401 '<content>' +4402 '<punctuation>\u2061</punctuation>' +4403 '</content>' +4404 '<children>' +4405 '<superscript>' +4406 '<children>' +4407 '<function>sin</function>' +4408 '<number>2</number>' +4409 '</children>' +4410 '</superscript>' +4411 '<identifier>x</identifier>' +4412 '</children>' +4413 '</appl>');4414 this.executeTreeTest(4415 '<mrow><msub><mi>sin</mi><mn>1</mn></msub><mi>x</mi></mrow>',4416 '<appl>' +4417 '<content>' +4418 '<punctuation>\u2061</punctuation>' +4419 '</content>' +4420 '<children>' +4421 '<subscript>' +4422 '<children>' +4423 '<function>sin</function>' +4424 '<number>1</number>' +4425 '</children>' +4426 '</subscript>' +4427 '<identifier>x</identifier>' +4428 '</children>' +4429 '</appl>');4430 this.executeTreeTest(4431 '<mrow><msubsup><mi>sin</mi><mn>2</mn><mn>1</mn></msubsup>' +4432 '<mi>x</mi></mrow>',4433 '<appl>' +4434 '<content>' +4435 '<punctuation>\u2061</punctuation>' +4436 '</content>' +4437 '<children>' +4438 '<superscript>' +4439 '<children>' +4440 '<subscript>' +4441 '<children>' +4442 '<function>sin</function>' +4443 '<number>2</number>' +4444 '</children>' +4445 '</subscript>' +4446 '<number>1</number>' +4447 '</children>' +4448 '</superscript>' +4449 '<identifier>x</identifier>' +4450 '</children>' +4451 '</appl>');4452 this.executeTreeTest(4453 '<mrow><msup><mi>sin</mi><mn>2</mn></msup><mi>x</mi><mo>+</mo><msup>' +4454 '<mi>cos</mi><mn>2</mn></msup><mi>y</mi><mo>=</mo><mn>1</mn></mrow>',4455 '<relseq>=' +4456 '<content>' +4457 '<relation>=</relation>' +4458 '</content>' +4459 '<children>' +4460 '<infixop>+' +4461 '<content>' +4462 '<operator>+</operator>' +4463 '</content>' +4464 '<children>' +4465 '<appl>' +4466 '<content>' +4467 '<punctuation>\u2061</punctuation>' +4468 '</content>' +4469 '<children>' +4470 '<superscript>' +4471 '<children>' +4472 '<function>sin</function>' +4473 '<number>2</number>' +4474 '</children>' +4475 '</superscript>' +4476 '<identifier>x</identifier>' +4477 '</children>' +4478 '</appl>' +4479 '<appl>' +4480 '<content>' +4481 '<punctuation>\u2061</punctuation>' +4482 '</content>' +4483 '<children>' +4484 '<superscript>' +4485 '<children>' +4486 '<function>cos</function>' +4487 '<number>2</number>' +4488 '</children>' +4489 '</superscript>' +4490 '<identifier>y</identifier>' +4491 '</children>' +4492 '</appl>' +4493 '</children>' +4494 '</infixop>' +4495 '<number>1</number>' +4496 '</children>' +4497 '</relseq>');4498 this.executeTreeTest(4499 '<mrow><msubsup><msubsup><mi>sin</mi><mn>2</mn><mn>1</mn>' +4500 '</msubsup><mi>n</mi><mi>m</mi></msubsup><mi>x</mi></mrow>',4501 '<appl>' +4502 '<content>' +4503 '<punctuation>\u2061</punctuation>' +4504 '</content>' +4505 '<children>' +4506 '<superscript>' +4507 '<children>' +4508 '<subscript>' +4509 '<children>' +4510 '<superscript>' +4511 '<children>' +4512 '<subscript>' +4513 '<children>' +4514 '<function>sin</function>' +4515 '<number>2</number>' +4516 '</children>' +4517 '</subscript>' +4518 '<number>1</number>' +4519 '</children>' +4520 '</superscript>' +4521 '<identifier>n</identifier>' +4522 '</children>' +4523 '</subscript>' +4524 '<identifier>m</identifier>' +4525 '</children>' +4526 '</superscript>' +4527 '<identifier>x</identifier>' +4528 '</children>' +4529 '</appl>');4530});4531/**4532 * Prefix functions without arguments.4533 */4534TEST_F('CvoxSemanticTreeUnitTest', 'StreePrefixFuncsNoArgs', function() {4535 this.brief = true;4536 this.executeTreeTest(4537 '<mi>sin</mi>',4538 '<function>sin</function>');4539 this.executeTreeTest(4540 '<msup><mi>sin</mi><mn>2</mn></msup>',4541 '<superscript>' +4542 '<children>' +4543 '<function>sin</function>' +4544 '<number>2</number>' +4545 '</children>' +4546 '</superscript>');4547 this.executeTreeTest(4548 '<msup><mi>sin</mi><mn>2</mn></msup><mo>+</mo><msup><mi>cos</mi>' +4549 '<mn>2</mn></msup>',4550 '<infixop>+' +4551 '<content>' +4552 '<operator>+</operator>' +4553 '</content>' +4554 '<children>' +4555 '<appl>' +4556 '<content>' +4557 '<punctuation>\u2061</punctuation>' +4558 '</content>' +4559 '<children>' +4560 '<superscript>' +4561 '<children>' +4562 '<function>sin</function>' +4563 '<number>2</number>' +4564 '</children>' +4565 '</superscript>' +4566 '<empty/>' +4567 '</children>' +4568 '</appl>' +4569 '<appl>' +4570 '<content>' +4571 '<punctuation>\u2061</punctuation>' +4572 '</content>' +4573 '<children>' +4574 '<superscript>' +4575 '<children>' +4576 '<function>cos</function>' +4577 '<number>2</number>' +4578 '</children>' +4579 '</superscript>' +4580 '<empty/>' +4581 '</children>' +4582 '</appl>' +4583 '</children>' +4584 '</infixop>');4585 this.executeTreeTest(4586 '<mrow><msup><mi>sin</mi><mn>2</mn></msup><mo>+</mo>' +4587 '<msup><mi>cos</mi><mn>2</mn></msup><mo>=</mo><mn>1</mn></mrow>',4588 '<relseq>=' +4589 '<content>' +4590 '<relation>=</relation>' +4591 '</content>' +4592 '<children>' +4593 '<infixop>+' +4594 '<content>' +4595 '<operator>+</operator>' +4596 '</content>' +4597 '<children>' +4598 '<appl>' +4599 '<content>' +4600 '<punctuation>\u2061</punctuation>' +4601 '</content>' +4602 '<children>' +4603 '<superscript>' +4604 '<children>' +4605 '<function>sin</function>' +4606 '<number>2</number>' +4607 '</children>' +4608 '</superscript>' +4609 '<empty/>' +4610 '</children>' +4611 '</appl>' +4612 '<appl>' +4613 '<content>' +4614 '<punctuation>\u2061</punctuation>' +4615 '</content>' +4616 '<children>' +4617 '<superscript>' +4618 '<children>' +4619 '<function>cos</function>' +4620 '<number>2</number>' +4621 '</children>' +4622 '</superscript>' +4623 '<empty/>' +4624 '</children>' +4625 '</appl>' +4626 '</children>' +4627 '</infixop>' +4628 '<number>1</number>' +4629 '</children>' +4630 '</relseq>');4631 this.executeTreeTest(4632 '<mrow><mi>sin</mi><mo>=</mo><mfrac><mn>1</mn>' +4633 '<mi>csc</mi></mfrac></mrow>',4634 '<relseq>=' +4635 '<content>' +4636 '<relation>=</relation>' +4637 '</content>' +4638 '<children>' +4639 '<appl>' +4640 '<content>' +4641 '<punctuation>\u2061</punctuation>' +4642 '</content>' +4643 '<children>' +4644 '<function>sin</function>' +4645 '<empty/>' +4646 '</children>' +4647 '</appl>' +4648 '<fraction>' +4649 '<children>' +4650 '<number>1</number>' +4651 '<function>csc</function>' +4652 '</children>' +4653 '</fraction>' +4654 '</children>' +4655 '</relseq>');4656});4657/**4658 * Nested prefix function applications, both with and without fenced arguments.4659 */4660TEST_F('CvoxSemanticTreeUnitTest', 'StreePrefixFuncsNested', function() {4661 this.brief = true;4662 this.executeTreeTest(4663 '<mrow><mi>log</mi><mi>cos</mi><mi>x</mi></mrow>',4664 '<appl>' +4665 '<content>' +4666 '<punctuation>\u2061</punctuation>' +4667 '</content>' +4668 '<children>' +4669 '<function>log</function>' +4670 '<appl>' +4671 '<content>' +4672 '<punctuation>\u2061</punctuation>' +4673 '</content>' +4674 '<children>' +4675 '<function>cos</function>' +4676 '<identifier>x</identifier>' +4677 '</children>' +4678 '</appl>' +4679 '</children>' +4680 '</appl>');4681 this.executeTreeTest(4682 '<mrow><mi>ln</mi><mo>' +4683 '(</mo><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>)</mo></mrow>',4684 '<appl>' +4685 '<content>' +4686 '<punctuation>\u2061</punctuation>' +4687 '</content>' +4688 '<children>' +4689 '<function>ln</function>' +4690 '<fenced>' +4691 '<content>' +4692 '<fence>(</fence>' +4693 '<fence>)</fence>' +4694 '</content>' +4695 '<children>' +4696 '<appl>' +4697 '<content>' +4698 '<punctuation>\u2061</punctuation>' +4699 '</content>' +4700 '<children>' +4701 '<function>sin</function>' +4702 '<fenced>' +4703 '<content>' +4704 '<fence>(</fence>' +4705 '<fence>)</fence>' +4706 '</content>' +4707 '<children>' +4708 '<identifier>x</identifier>' +4709 '</children>' +4710 '</fenced>' +4711 '</children>' +4712 '</appl>' +4713 '</children>' +4714 '</fenced>' +4715 '</children>' +4716 '</appl>');4717 this.executeTreeTest(4718 '<mrow><mi>log</mi><mi>cos</mi><mi>x</mi><mo>=' +4719 '</mo><mi>ln</mi><mo>(</mo><mi>sin</mi><mo>' +4720 '(</mo><mi>x</mi><mo>)</mo><mo>)</mo></mrow>',4721 '<relseq>=' +4722 '<content>' +4723 '<relation>=</relation>' +4724 '</content>' +4725 '<children>' +4726 '<appl>' +4727 '<content>' +4728 '<punctuation>\u2061</punctuation>' +4729 '</content>' +4730 '<children>' +4731 '<function>log</function>' +4732 '<appl>' +4733 '<content>' +4734 '<punctuation>\u2061</punctuation>' +4735 '</content>' +4736 '<children>' +4737 '<function>cos</function>' +4738 '<identifier>x</identifier>' +4739 '</children>' +4740 '</appl>' +4741 '</children>' +4742 '</appl>' +4743 '<appl>' +4744 '<content>' +4745 '<punctuation>\u2061</punctuation>' +4746 '</content>' +4747 '<children>' +4748 '<function>ln</function>' +4749 '<fenced>' +4750 '<content>' +4751 '<fence>(</fence>' +4752 '<fence>)</fence>' +4753 '</content>' +4754 '<children>' +4755 '<appl>' +4756 '<content>' +4757 '<punctuation>\u2061</punctuation>' +4758 '</content>' +4759 '<children>' +4760 '<function>sin</function>' +4761 '<fenced>' +4762 '<content>' +4763 '<fence>(</fence>' +4764 '<fence>)</fence>' +4765 '</content>' +4766 '<children>' +4767 '<identifier>x</identifier>' +4768 '</children>' +4769 '</fenced>' +4770 '</children>' +4771 '</appl>' +4772 '</children>' +4773 '</fenced>' +4774 '</children>' +4775 '</appl>' +4776 '</children>' +4777 '</relseq>');4778});4779/**4780 * Variations of tables representing matrices, vectors, case statements,4781 * multiline equations and regular tables.4782 */4783TEST_F('CvoxSemanticTreeUnitTest', 'StreeTables', function() {4784 this.brief = false;4785 this.executeTreeTest(4786 '<mrow class="MJX-TeXAtom-ORD"><mi mathvariant="bold">A</mi>' +4787 '<mo>=</mo><mo>[</mo><mtable rowspacing="4pt" columnspacing="1em">' +4788 '<mtr><mtd><mn>0</mn></mtd><mtd><mn>1</mn></mtd></mtr><mtr><mtd>' +4789 '<mn>2</mn></mtd><mtd><mn>3</mn></mtd></mtr></mtable><mo>]</mo>' +4790 '</mrow>',4791 '<relseq role="equality" id="16">=' +4792 '<content>' +4793 '<relation role="equality" id="1">=</relation>' +4794 '</content>' +4795 '<children>' +4796 '<identifier role="latinletter" font="bold" id="0">A</identifier>' +4797 '<matrix role="unknown" id="13">' +4798 '<content>' +4799 '<fence role="open" id="2">[</fence>' +4800 '<fence role="close" id="14">]</fence>' +4801 '</content>' +4802 '<children>' +4803 '<row role="matrix" id="7">' +4804 '<children>' +4805 '<cell role="matrix" id="4">' +4806 '<children>' +4807 '<number role="integer" font="normal" id="3">0</number>' +4808 '</children>' +4809 '</cell>' +4810 '<cell role="matrix" id="6">' +4811 '<children>' +4812 '<number role="integer" font="normal" id="5">1</number>' +4813 '</children>' +4814 '</cell>' +4815 '</children>' +4816 '</row>' +4817 '<row role="matrix" id="12">' +4818 '<children>' +4819 '<cell role="matrix" id="9">' +4820 '<children>' +4821 '<number role="integer" font="normal" id="8">2</number>' +4822 '</children>' +4823 '</cell>' +4824 '<cell role="matrix" id="11">' +4825 '<children>' +4826 '<number role="integer" font="normal" id="10">3</number>' +4827 '</children>' +4828 '</cell>' +4829 '</children>' +4830 '</row>' +4831 '</children>' +4832 '</matrix>' +4833 '</children>' +4834 '</relseq>');4835 this.executeTreeTest(4836 '<mo>[</mo><mtable rowspacing="4pt" columnspacing="1em"><mtr>' +4837 '<mtd><mn>0</mn></mtd><mtd><mn>1</mn></mtd></mtr><mtr><mtd>' +4838 '<mn>2</mn></mtd><mtd><mn>3</mn></mtd></mtr></mtable>' +4839 '<mo>]</mo>',4840 '<matrix role="unknown" id="11">' +4841 '<content>' +4842 '<fence role="open" id="0">[</fence>' +4843 '<fence role="close" id="12">]</fence>' +4844 '</content>' +4845 '<children>' +4846 '<row role="matrix" id="5">' +4847 '<children>' +4848 '<cell role="matrix" id="2">' +4849 '<children>' +4850 '<number role="integer" font="normal" id="1">0</number>' +4851 '</children>' +4852 '</cell>' +4853 '<cell role="matrix" id="4">' +4854 '<children>' +4855 '<number role="integer" font="normal" id="3">1</number>' +4856 '</children>' +4857 '</cell>' +4858 '</children>' +4859 '</row>' +4860 '<row role="matrix" id="10">' +4861 '<children>' +4862 '<cell role="matrix" id="7">' +4863 '<children>' +4864 '<number role="integer" font="normal" id="6">2</number>' +4865 '</children>' +4866 '</cell>' +4867 '<cell role="matrix" id="9">' +4868 '<children>' +4869 '<number role="integer" font="normal" id="8">3</number>' +4870 '</children>' +4871 '</cell>' +4872 '</children>' +4873 '</row>' +4874 '</children>' +4875 '</matrix>');4876 this.executeTreeTest(4877 '<mrow class="MJX-TeXAtom-ORD"><mi mathvariant="bold">V</mi>' +4878 '<mo>=</mo><mo>[</mo><mtable rowspacing="4pt" columnspacing="1em">' +4879 '<mtr><mtd><mn>1</mn></mtd></mtr><mtr><mtd><mn>2</mn></mtd></mtr>' +4880 '<mtr><mtd><mn>3</mn></mtd></mtr></mtable><mo>]</mo></mrow>',4881 '<relseq role="equality" id="15">=' +4882 '<content>' +4883 '<relation role="equality" id="1">=</relation>' +4884 '</content>' +4885 '<children>' +4886 '<identifier role="latinletter" font="bold" id="0">V</identifier>' +4887 '<vector role="unknown" id="12">' +4888 '<content>' +4889 '<fence role="open" id="2">[</fence>' +4890 '<fence role="close" id="13">]</fence>' +4891 '</content>' +4892 '<children>' +4893 '<line role="vector" id="5">' +4894 '<children>' +4895 '<number role="integer" font="normal" id="3">1</number>' +4896 '</children>' +4897 '</line>' +4898 '<line role="vector" id="8">' +4899 '<children>' +4900 '<number role="integer" font="normal" id="6">2</number>' +4901 '</children>' +4902 '</line>' +4903 '<line role="vector" id="11">' +4904 '<children>' +4905 '<number role="integer" font="normal" id="9">3</number>' +4906 '</children>' +4907 '</line>' +4908 '</children>' +4909 '</vector>' +4910 '</children>' +4911 '</relseq>');4912 this.executeTreeTest(4913 '<mo>[</mo><mtable rowspacing="4pt" columnspacing="1em">' +4914 '<mtr><mtd><mn>1</mn></mtd></mtr><mtr><mtd><mn>2</mn></mtd></mtr>' +4915 '<mtr><mtd><mn>3</mn></mtd></mtr></mtable><mo>]</mo>',4916 '<vector role="unknown" id="10">' +4917 '<content>' +4918 '<fence role="open" id="0">[</fence>' +4919 '<fence role="close" id="11">]</fence>' +4920 '</content>' +4921 '<children>' +4922 '<line role="vector" id="3">' +4923 '<children>' +4924 '<number role="integer" font="normal" id="1">1</number>' +4925 '</children>' +4926 '</line>' +4927 '<line role="vector" id="6">' +4928 '<children>' +4929 '<number role="integer" font="normal" id="4">2</number>' +4930 '</children>' +4931 '</line>' +4932 '<line role="vector" id="9">' +4933 '<children>' +4934 '<number role="integer" font="normal" id="7">3</number>' +4935 '</children>' +4936 '</line>' +4937 '</children>' +4938 '</vector>');4939 this.executeTreeTest(4940 '<mrow><mo>{</mo><mtable><mtr><mtd><mi>a</mi></mtd><mtd>' +4941 '<mtext>often</mtext></mtd></mtr><mtr><mtd><mi>b</mi></mtd>' +4942 '<mtd><mtext>sometimes</mtext></mtd></mtr></mtable></mrow>',4943 '<cases role="unknown" id="11">' +4944 '<content>' +4945 '<punctuation role="openfence" id="0">{</punctuation>' +4946 '</content>' +4947 '<children>' +4948 '<row role="cases" id="5">' +4949 '<children>' +4950 '<cell role="cases" id="2">' +4951 '<children>' +4952 '<identifier role="latinletter" font="normal" id="1">a</identifier>' +4953 '</children>' +4954 '</cell>' +4955 '<cell role="cases" id="4">' +4956 '<children>' +4957 '<text role="unknown" id="3">often</text>' +4958 '</children>' +4959 '</cell>' +4960 '</children>' +4961 '</row>' +4962 '<row role="cases" id="10">' +4963 '<children>' +4964 '<cell role="cases" id="7">' +4965 '<children>' +4966 '<identifier role="latinletter" font="normal" id="6">b</identifier>' +4967 '</children>' +4968 '</cell>' +4969 '<cell role="cases" id="9">' +4970 '<children>' +4971 '<text role="unknown" id="8">sometimes</text>' +4972 '</children>' +4973 '</cell>' +4974 '</children>' +4975 '</row>' +4976 '</children>' +4977 '</cases>');4978 this.executeTreeTest(4979 '<mrow><mi mathvariant="bold">A</mi><mo>=</mo><mo>{</mo><mtable>' +4980 '<mtr><mtd><mi>a</mi></mtd><mtd><mtext>often</mtext></mtd></mtr>' +4981 '<mtr><mtd><mi>b</mi></mtd><mtd><mtext>sometimes</mtext></mtd></mtr>' +4982 '</mtable></mrow>',4983 '<relseq role="equality" id="14">=' +4984 '<content>' +4985 '<relation role="equality" id="1">=</relation>' +4986 '</content>' +4987 '<children>' +4988 '<identifier role="latinletter" font="bold" id="0">A</identifier>' +4989 '<cases role="unknown" id="13">' +4990 '<content>' +4991 '<punctuation role="openfence" id="2">{</punctuation>' +4992 '</content>' +4993 '<children>' +4994 '<row role="cases" id="7">' +4995 '<children>' +4996 '<cell role="cases" id="4">' +4997 '<children>' +4998 '<identifier role="latinletter" font="normal" id="3">a</identifier>' +4999 '</children>' +5000 '</cell>' +5001 '<cell role="cases" id="6">' +5002 '<children>' +5003 '<text role="unknown" id="5">often</text>' +5004 '</children>' +5005 '</cell>' +5006 '</children>' +5007 '</row>' +5008 '<row role="cases" id="12">' +5009 '<children>' +5010 '<cell role="cases" id="9">' +5011 '<children>' +5012 '<identifier role="latinletter" font="normal" id="8">b</identifier>' +5013 '</children>' +5014 '</cell>' +5015 '<cell role="cases" id="11">' +5016 '<children>' +5017 '<text role="unknown" id="10">sometimes</text>' +5018 '</children>' +5019 '</cell>' +5020 '</children>' +5021 '</row>' +5022 '</children>' +5023 '</cases>' +5024 '</children>' +5025 '</relseq>');5026 this.executeTreeTest(5027 '<mrow><mo>{</mo><mtable><mtr><mtd><mi>a</mi></mtd><mtd>' +5028 '<mtext>often</mtext></mtd></mtr><mtr><mtd><mi>b</mi></mtd><mtd>' +5029 '<mtext>sometimes</mtext></mtd></mtr></mtable><mo>.</mo></mrow>',5030 '<punctuated role="endpunct" id="13">' +5031 '<content>' +5032 '<punctuation role="fullstop" id="12">.</punctuation>' +5033 '</content>' +5034 '<children>' +5035 '<cases role="unknown" id="11">' +5036 '<content>' +5037 '<punctuation role="openfence" id="0">{</punctuation>' +5038 '</content>' +5039 '<children>' +5040 '<row role="cases" id="5">' +5041 '<children>' +5042 '<cell role="cases" id="2">' +5043 '<children>' +5044 '<identifier role="latinletter" font="normal" id="1">a</identifier>' +5045 '</children>' +5046 '</cell>' +5047 '<cell role="cases" id="4">' +5048 '<children>' +5049 '<text role="unknown" id="3">often</text>' +5050 '</children>' +5051 '</cell>' +5052 '</children>' +5053 '</row>' +5054 '<row role="cases" id="10">' +5055 '<children>' +5056 '<cell role="cases" id="7">' +5057 '<children>' +5058 '<identifier role="latinletter" font="normal" id="6">b</identifier>' +5059 '</children>' +5060 '</cell>' +5061 '<cell role="cases" id="9">' +5062 '<children>' +5063 '<text role="unknown" id="8">sometimes</text>' +5064 '</children>' +5065 '</cell>' +5066 '</children>' +5067 '</row>' +5068 '</children>' +5069 '</cases>' +5070 '<punctuation role="fullstop" id="12">.</punctuation>' +5071 '</children>' +5072 '</punctuated>');5073 this.executeTreeTest(5074 '<mrow><mo>{</mo><mtable><mtr><mtd><mi>a</mi></mtd>' +5075 '<mtd><mtext>often</mtext></mtd></mtr><mtr><mtd><mi>b</mi></mtd>' +5076 '<mtd><mtext>sometimes</mtext></mtd></mtr></mtable>' +5077 '<mo>,</mo><mi>b</mi><mo>,</mo><mi>c</mi><mo>.</mo></mrow>',5078 '<punctuated role="sequence" id="17">' +5079 '<content>' +5080 '<punctuation role="unknown" id="12">,</punctuation>' +5081 '<punctuation role="unknown" id="14">,</punctuation>' +5082 '<punctuation role="fullstop" id="16">.</punctuation>' +5083 '</content>' +5084 '<children>' +5085 '<cases role="unknown" id="11">' +5086 '<content>' +5087 '<punctuation role="openfence" id="0">{</punctuation>' +5088 '</content>' +5089 '<children>' +5090 '<row role="cases" id="5">' +5091 '<children>' +5092 '<cell role="cases" id="2">' +5093 '<children>' +5094 '<identifier role="latinletter" font="normal" id="1">a</identifier>' +5095 '</children>' +5096 '</cell>' +5097 '<cell role="cases" id="4">' +5098 '<children>' +5099 '<text role="unknown" id="3">often</text>' +5100 '</children>' +5101 '</cell>' +5102 '</children>' +5103 '</row>' +5104 '<row role="cases" id="10">' +5105 '<children>' +5106 '<cell role="cases" id="7">' +5107 '<children>' +5108 '<identifier role="latinletter" font="normal" id="6">b</identifier>' +5109 '</children>' +5110 '</cell>' +5111 '<cell role="cases" id="9">' +5112 '<children>' +5113 '<text role="unknown" id="8">sometimes</text>' +5114 '</children>' +5115 '</cell>' +5116 '</children>' +5117 '</row>' +5118 '</children>' +5119 '</cases>' +5120 '<punctuation role="unknown" id="12">,</punctuation>' +5121 '<identifier role="latinletter" font="normal" id="13">b</identifier>' +5122 '<punctuation role="unknown" id="14">,</punctuation>' +5123 '<identifier role="latinletter" font="normal" id="15">c</identifier>' +5124 '<punctuation role="fullstop" id="16">.</punctuation>' +5125 '</children>' +5126 '</punctuated>');5127 this.executeTreeTest(5128 '<mrow><mo>{</mo><mtable><mtr><mtd><mi>a</mi><mo>,</mo>' +5129 '<mtext>often</mtext></mtd></mtr><mtr><mtd><mi>b</mi><mo>,</mo>' +5130 '<mtext>sometimes</mtext></mtd></mtr></mtable><mo>,</mo><mi>b</mi>' +5131 '<mo>,</mo><mi>c</mi><mo>.</mo></mrow>',5132 '<punctuated role="sequence" id="19">' +5133 '<content>' +5134 '<punctuation role="unknown" id="14">,</punctuation>' +5135 '<punctuation role="unknown" id="16">,</punctuation>' +5136 '<punctuation role="fullstop" id="18">.</punctuation>' +5137 '</content>' +5138 '<children>' +5139 '<cases role="unknown" id="13">' +5140 '<content>' +5141 '<punctuation role="openfence" id="0">{</punctuation>' +5142 '</content>' +5143 '<children>' +5144 '<line role="cases" id="6">' +5145 '<children>' +5146 '<punctuated role="sequence" id="4">' +5147 '<content>' +5148 '<punctuation role="unknown" id="2">,</punctuation>' +5149 '</content>' +5150 '<children>' +5151 '<identifier role="latinletter" font="normal" id="1">a</identifier>' +5152 '<punctuation role="unknown" id="2">,</punctuation>' +5153 '<text role="unknown" id="3">often</text>' +5154 '</children>' +5155 '</punctuated>' +5156 '</children>' +5157 '</line>' +5158 '<line role="cases" id="12">' +5159 '<children>' +5160 '<punctuated role="sequence" id="10">' +5161 '<content>' +5162 '<punctuation role="unknown" id="8">,</punctuation>' +5163 '</content>' +5164 '<children>' +5165 '<identifier role="latinletter" font="normal" id="7">b</identifier>' +5166 '<punctuation role="unknown" id="8">,</punctuation>' +5167 '<text role="unknown" id="9">sometimes</text>' +5168 '</children>' +5169 '</punctuated>' +5170 '</children>' +5171 '</line>' +5172 '</children>' +5173 '</cases>' +5174 '<punctuation role="unknown" id="14">,</punctuation>' +5175 '<identifier role="latinletter" font="normal" id="15">b</identifier>' +5176 '<punctuation role="unknown" id="16">,</punctuation>' +5177 '<identifier role="latinletter" font="normal" id="17">c</identifier>' +5178 '<punctuation role="fullstop" id="18">.</punctuation>' +5179 '</children>' +5180 '</punctuated>');5181 this.executeTreeTest(5182 '<mtable><mtr><mtd><mi>x</mi><maligngroup/><mo>=</mo><mn>4</mn>' +5183 '</mtd></mtr><mtr><mtd><mi>y</mi><maligngroup/><mo>=</mo><mn>2</mn>' +5184 '</mtd></mtr><mtr><mtd><mi>x</mi><mi>y</mi><maligngroup/><mo>=</mo>' +5185 '<mn>6</mn></mtd></mtr></mtable>',5186 '<multiline role="unknown" id="21">' +5187 '<children>' +5188 '<line role="multiline" id="5">' +5189 '<children>' +5190 '<relseq role="equality" id="3">=' +5191 '<content>' +5192 '<relation role="equality" id="1">=</relation>' +5193 '</content>' +5194 '<children>' +5195 '<identifier role="latinletter" font="normal" id="0">x</identifier>' +5196 '<number role="integer" font="normal" id="2">4</number>' +5197 '</children>' +5198 '</relseq>' +5199 '</children>' +5200 '</line>' +5201 '<line role="multiline" id="11">' +5202 '<children>' +5203 '<relseq role="equality" id="9">=' +5204 '<content>' +5205 '<relation role="equality" id="7">=</relation>' +5206 '</content>' +5207 '<children>' +5208 '<identifier role="latinletter" font="normal" id="6">y</identifier>' +5209 '<number role="integer" font="normal" id="8">2</number>' +5210 '</children>' +5211 '</relseq>' +5212 '</children>' +5213 '</line>' +5214 '<line role="multiline" id="20">' +5215 '<children>' +5216 '<relseq role="equality" id="18">=' +5217 '<content>' +5218 '<relation role="equality" id="14">=</relation>' +5219 '</content>' +5220 '<children>' +5221 '<infixop role="implicit" id="17">\u2062' +5222 '<content>' +5223 '<operator role="multiplication" id="16">\u2062</operator>' +5224 '</content>' +5225 '<children>' +5226 '<identifier role="latinletter" font="normal" id="12">x</identifier>' +5227 '<identifier role="latinletter" font="normal" id="13">y</identifier>' +5228 '</children>' +5229 '</infixop>' +5230 '<number role="integer" font="normal" id="15">6</number>' +5231 '</children>' +5232 '</relseq>' +5233 '</children>' +5234 '</line>' +5235 '</children>' +5236 '</multiline>');5237 this.executeTreeTest(5238 '<mtable><mtr><mtd><mi>x</mi></mtd><mtd><mo>=</mo></mtd><mtd><mn>4</mn>' +5239 '</mtd></mtr><mtr><mtd><mi>y</mi></mtd><mtd><mo>=</mo></mtd><mtd>' +5240 '<mn>2</mn></mtd></mtr><mtr><mtd><mi>x</mi><mi>y</mi></mtd><mtd>' +5241 '<mo>=</mo></mtd><mtd><mn>6</mn></mtd></mtr></mtable>',5242 '<table role="unknown" id="24">' +5243 '<children>' +5244 '<row role="table" id="6">' +5245 '<children>' +5246 '<cell role="table" id="1">' +5247 '<children>' +5248 '<identifier role="latinletter" font="normal" id="0">x</identifier>' +5249 '</children>' +5250 '</cell>' +5251 '<cell role="table" id="3">' +5252 '<children>' +5253 '<relation role="equality" id="2">=</relation>' +5254 '</children>' +5255 '</cell>' +5256 '<cell role="table" id="5">' +5257 '<children>' +5258 '<number role="integer" font="normal" id="4">4</number>' +5259 '</children>' +5260 '</cell>' +5261 '</children>' +5262 '</row>' +5263 '<row role="table" id="13">' +5264 '<children>' +5265 '<cell role="table" id="8">' +5266 '<children>' +5267 '<identifier role="latinletter" font="normal" id="7">y</identifier>' +5268 '</children>' +5269 '</cell>' +5270 '<cell role="table" id="10">' +5271 '<children>' +5272 '<relation role="equality" id="9">=</relation>' +5273 '</children>' +5274 '</cell>' +5275 '<cell role="table" id="12">' +5276 '<children>' +5277 '<number role="integer" font="normal" id="11">2</number>' +5278 '</children>' +5279 '</cell>' +5280 '</children>' +5281 '</row>' +5282 '<row role="table" id="23">' +5283 '<children>' +5284 '<cell role="table" id="18">' +5285 '<children>' +5286 '<infixop role="implicit" id="17">\u2062' +5287 '<content>' +5288 '<operator role="multiplication" id="16">\u2062</operator>' +5289 '</content>' +5290 '<children>' +5291 '<identifier role="latinletter" font="normal" id="14">x</identifier>' +5292 '<identifier role="latinletter" font="normal" id="15">y</identifier>' +5293 '</children>' +5294 '</infixop>' +5295 '</children>' +5296 '</cell>' +5297 '<cell role="table" id="20">' +5298 '<children>' +5299 '<relation role="equality" id="19">=</relation>' +5300 '</children>' +5301 '</cell>' +5302 '<cell role="table" id="22">' +5303 '<children>' +5304 '<number role="integer" font="normal" id="21">6</number>' +5305 '</children>' +5306 '</cell>' +5307 '</children>' +5308 '</row>' +5309 '</children>' +5310 '</table>');5311});5312TEST_F('CvoxSemanticTreeUnitTest', 'StreeLimitFunctions', function() {5313 this.brief = true;5314 this.executeTreeTest(5315 '<mrow><munder><mi>lim</mi><mrow><mi>x</mi><mo>\u2192</mo>' +5316 '<mi>\u221E</mi></mrow></munder><mo>(</mo><mi>x</mi><mo>)</mo></mrow>',5317 '<appl>' +5318 '<content>' +5319 '<punctuation>\u2061</punctuation>' +5320 '</content>' +5321 '<children>' +5322 '<limlower>' +5323 '<children>' +5324 '<function>lim</function>' +5325 '<relseq>\u2192' +5326 '<content>' +5327 '<relation>\u2192</relation>' +5328 '</content>' +5329 '<children>' +5330 '<identifier>x</identifier>' +5331 '<identifier>\u221E</identifier>' +5332 '</children>' +5333 '</relseq>' +5334 '</children>' +5335 '</limlower>' +5336 '<fenced>' +5337 '<content>' +5338 '<fence>(</fence>' +5339 '<fence>)</fence>' +5340 '</content>' +5341 '<children>' +5342 '<identifier>x</identifier>' +5343 '</children>' +5344 '</fenced>' +5345 '</children>' +5346 '</appl>');5347 this.executeTreeTest(5348 '<mrow><mi>a</mi><mo>+</mo><munder><mi>lim</mi><mrow><mi>x</mi>' +5349 '<mo>\u2192</mo><mi>\u221E</mi></mrow></munder><mo>(</mo><mi>x</mi>' +5350 '<mo>)</mo><mo>+</mo><mi>b</mi></mrow>',5351 '<infixop>+' +5352 '<content>' +5353 '<operator>+</operator>' +5354 '<operator>+</operator>' +5355 '</content>' +5356 '<children>' +5357 '<identifier>a</identifier>' +5358 '<appl>' +5359 '<content>' +5360 '<punctuation>\u2061</punctuation>' +5361 '</content>' +5362 '<children>' +5363 '<limlower>' +5364 '<children>' +5365 '<function>lim</function>' +5366 '<relseq>\u2192' +5367 '<content>' +5368 '<relation>\u2192</relation>' +5369 '</content>' +5370 '<children>' +5371 '<identifier>x</identifier>' +5372 '<identifier>\u221E</identifier>' +5373 '</children>' +5374 '</relseq>' +5375 '</children>' +5376 '</limlower>' +5377 '<fenced>' +5378 '<content>' +5379 '<fence>(</fence>' +5380 '<fence>)</fence>' +5381 '</content>' +5382 '<children>' +5383 '<identifier>x</identifier>' +5384 '</children>' +5385 '</fenced>' +5386 '</children>' +5387 '</appl>' +5388 '<identifier>b</identifier>' +5389 '</children>' +5390 '</infixop>');5391 this.executeTreeTest(5392 '<mrow><msup><munder><mi>lim</mi><mrow><mi>x</mi><mo>\u2192</mo>' +5393 '<mi>\u221E</mi></mrow></munder><mo>+</mo></msup><mo>(</mo><mi>x</mi>' +5394 '<mo>)</mo></mrow>',5395 '<appl>' +5396 '<content>' +5397 '<punctuation>\u2061</punctuation>' +5398 '</content>' +5399 '<children>' +5400 '<limupper>' +5401 '<children>' +5402 '<limlower>' +5403 '<children>' +5404 '<function>lim</function>' +5405 '<relseq>\u2192' +5406 '<content>' +5407 '<relation>\u2192</relation>' +5408 '</content>' +5409 '<children>' +5410 '<identifier>x</identifier>' +5411 '<identifier>\u221E</identifier>' +5412 '</children>' +5413 '</relseq>' +5414 '</children>' +5415 '</limlower>' +5416 '<operator>+</operator>' +5417 '</children>' +5418 '</limupper>' +5419 '<fenced>' +5420 '<content>' +5421 '<fence>(</fence>' +5422 '<fence>)</fence>' +5423 '</content>' +5424 '<children>' +5425 '<identifier>x</identifier>' +5426 '</children>' +5427 '</fenced>' +5428 '</children>' +5429 '</appl>');5430 this.executeTreeTest(5431 '<mrow><munderover><mi>lim</mi><mo>\u2015</mo><mrow><mi>x</mi>' +5432 '<mo>\u2192</mo><mi>\u221E</mi></mrow></munderover><mo>(</mo>' +5433 '<mi>x</mi><mo>)</mo></mrow>',5434 '<appl>' +5435 '<content>' +5436 '<punctuation>\u2061</punctuation>' +5437 '</content>' +5438 '<children>' +5439 '<limboth>' +5440 '<children>' +5441 '<function>lim</function>' +5442 '<punctuation>\u2015</punctuation>' +5443 '<relseq>\u2192' +5444 '<content>' +5445 '<relation>\u2192</relation>' +5446 '</content>' +5447 '<children>' +5448 '<identifier>x</identifier>' +5449 '<identifier>\u221E</identifier>' +5450 '</children>' +5451 '</relseq>' +5452 '</children>' +5453 '</limboth>' +5454 '<fenced>' +5455 '<content>' +5456 '<fence>(</fence>' +5457 '<fence>)</fence>' +5458 '</content>' +5459 '<children>' +5460 '<identifier>x</identifier>' +5461 '</children>' +5462 '</fenced>' +5463 '</children>' +5464 '</appl>');5465 this.executeTreeTest(5466 '<mrow><munder><mi>liminf</mi><mrow><mi>x</mi><mo>\u2192</mo>' +5467 '<mi>\u221E</mi></mrow></munder><mo>(</mo><mi>x</mi><mo>)</mo>' +5468 '<mo>+</mo><munder><mi>limsup</mi><mrow><mi>y</mi><mo>\u2192</mo>' +5469 '<mi>\u221E</mi></mrow></munder><mo>(</mo><mi>y</mi><mo>)</mo></mrow>',5470 '<infixop>+' +5471 '<content>' +5472 '<operator>+</operator>' +5473 '</content>' +5474 '<children>' +5475 '<appl>' +5476 '<content>' +5477 '<punctuation>\u2061</punctuation>' +5478 '</content>' +5479 '<children>' +5480 '<limlower>' +5481 '<children>' +5482 '<function>liminf</function>' +5483 '<relseq>\u2192' +5484 '<content>' +5485 '<relation>\u2192</relation>' +5486 '</content>' +5487 '<children>' +5488 '<identifier>x</identifier>' +5489 '<identifier>\u221E</identifier>' +5490 '</children>' +5491 '</relseq>' +5492 '</children>' +5493 '</limlower>' +5494 '<fenced>' +5495 '<content>' +5496 '<fence>(</fence>' +5497 '<fence>)</fence>' +5498 '</content>' +5499 '<children>' +5500 '<identifier>x</identifier>' +5501 '</children>' +5502 '</fenced>' +5503 '</children>' +5504 '</appl>' +5505 '<appl>' +5506 '<content>' +5507 '<punctuation>\u2061</punctuation>' +5508 '</content>' +5509 '<children>' +5510 '<limlower>' +5511 '<children>' +5512 '<function>limsup</function>' +5513 '<relseq>\u2192' +5514 '<content>' +5515 '<relation>\u2192</relation>' +5516 '</content>' +5517 '<children>' +5518 '<identifier>y</identifier>' +5519 '<identifier>\u221E</identifier>' +5520 '</children>' +5521 '</relseq>' +5522 '</children>' +5523 '</limlower>' +5524 '<fenced>' +5525 '<content>' +5526 '<fence>(</fence>' +5527 '<fence>)</fence>' +5528 '</content>' +5529 '<children>' +5530 '<identifier>y</identifier>' +5531 '</children>' +5532 '</fenced>' +5533 '</children>' +5534 '</appl>' +5535 '</children>' +5536 '</infixop>');5537 this.executeTreeTest(5538 '<mrow><mi>a</mi><mo>+</mo><munder><mi>lim</mi><mrow><mi>x</mi>' +5539 '<mo>\u2192</mo><mi>\u221E</mi></mrow></munder><mi>x</mi><mo>+</mo>' +5540 '<mi>b</mi></mrow>',5541 '<infixop>+' +5542 '<content>' +5543 '<operator>+</operator>' +5544 '<operator>+</operator>' +5545 '</content>' +5546 '<children>' +5547 '<identifier>a</identifier>' +5548 '<appl>' +5549 '<content>' +5550 '<punctuation>\u2061</punctuation>' +5551 '</content>' +5552 '<children>' +5553 '<limlower>' +5554 '<children>' +5555 '<function>lim</function>' +5556 '<relseq>\u2192' +5557 '<content>' +5558 '<relation>\u2192</relation>' +5559 '</content>' +5560 '<children>' +5561 '<identifier>x</identifier>' +5562 '<identifier>\u221E</identifier>' +5563 '</children>' +5564 '</relseq>' +5565 '</children>' +5566 '</limlower>' +5567 '<identifier>x</identifier>' +5568 '</children>' +5569 '</appl>' +5570 '<identifier>b</identifier>' +5571 '</children>' +5572 '</infixop>');5573 this.executeTreeTest(5574 '<mrow><munder><mi>lim</mi><mrow><mi>x</mi><mo>\u2192</mo><mi>\u221E</mi>' +5575 '</mrow></munder><mi>lim</mi><munder><mrow><mi>y</mi><mo>\u2192</mo>' +5576 '<mi>\u221E</mi></mrow></munder><mi>x</mi><mi>y</mi></mrow>',5577 '<appl>' +5578 '<content>' +5579 '<punctuation>\u2061</punctuation>' +5580 '</content>' +5581 '<children>' +5582 '<limlower>' +5583 '<children>' +5584 '<function>lim</function>' +5585 '<relseq>\u2192' +5586 '<content>' +5587 '<relation>\u2192</relation>' +5588 '</content>' +5589 '<children>' +5590 '<identifier>x</identifier>' +5591 '<identifier>\u221E</identifier>' +5592 '</children>' +5593 '</relseq>' +5594 '</children>' +5595 '</limlower>' +5596 '<appl>' +5597 '<content>' +5598 '<punctuation>\u2061</punctuation>' +5599 '</content>' +5600 '<children>' +5601 '<function>lim</function>' +5602 '<infixop>\u2062' +5603 '<content>' +5604 '<operator>\u2062</operator>' +5605 '</content>' +5606 '<children>' +5607 '<underscore>' +5608 '<children>' +5609 '<relseq>\u2192' +5610 '<content>' +5611 '<relation>\u2192</relation>' +5612 '</content>' +5613 '<children>' +5614 '<identifier>y</identifier>' +5615 '<identifier>\u221E</identifier>' +5616 '</children>' +5617 '</relseq>' +5618 '</children>' +5619 '</underscore>' +5620 '<identifier>x</identifier>' +5621 '<identifier>y</identifier>' +5622 '</children>' +5623 '</infixop>' +5624 '</children>' +5625 '</appl>' +5626 '</children>' +5627 '</appl>');5628 this.executeTreeTest(5629 '<mi>liminf</mi>',5630 '<function>liminf</function>');5631 this.executeTreeTest(5632 '<munder><mi>lim</mi><mrow><mi>x</mi><mo>\u2192</mo><mi>\u221E</mi>' +5633 '</mrow></munder>',5634 '<limlower>' +5635 '<children>' +5636 '<function>lim</function>' +5637 '<relseq>\u2192' +5638 '<content>' +5639 '<relation>\u2192</relation>' +5640 '</content>' +5641 '<children>' +5642 '<identifier>x</identifier>' +5643 '<identifier>\u221E</identifier>' +5644 '</children>' +5645 '</relseq>' +5646 '</children>' +5647 '</limlower>');5648 this.executeTreeTest(5649 '<mi>liminf</mi><mo>+</mo><mi>limsup</mi><mo>=</mo><mi>lim</mi>',5650 '<relseq>=' +5651 '<content>' +5652 '<relation>=</relation>' +5653 '</content>' +5654 '<children>' +5655 '<infixop>+' +5656 '<content>' +5657 '<operator>+</operator>' +5658 '</content>' +5659 '<children>' +5660 '<appl>' +5661 '<content>' +5662 '<punctuation>\u2061</punctuation>' +5663 '</content>' +5664 '<children>' +5665 '<function>liminf</function>' +5666 '<empty/>' +5667 '</children>' +5668 '</appl>' +5669 '<appl>' +5670 '<content>' +5671 '<punctuation>\u2061</punctuation>' +5672 '</content>' +5673 '<children>' +5674 '<function>limsup</function>' +5675 '<empty/>' +5676 '</children>' +5677 '</appl>' +5678 '</children>' +5679 '</infixop>' +5680 '<appl>' +5681 '<content>' +5682 '<punctuation>\u2061</punctuation>' +5683 '</content>' +5684 '<children>' +5685 '<function>lim</function>' +5686 '<empty/>' +5687 '</children>' +5688 '</appl>' +5689 '</children>' +5690 '</relseq>');5691});5692/**5693 * Variations of big operators.5694 */5695TEST_F('CvoxSemanticTreeUnitTest', 'StreeBigOps', function() {5696 this.brief = true;5697 this.executeTreeTest(5698 '<mrow><munderover><mi>\u2211</mi><mrow><mi>n</mi><mo>=</mo><mn>0</mn>' +5699 '</mrow><mi>\u221E</mi></munderover><msup><mi>n</mi><mn>2</mn>' +5700 '</msup></mrow>',5701 '<bigop>' +5702 '<children>' +5703 '<limboth>' +5704 '<children>' +5705 '<largeop>\u2211</largeop>' +5706 '<relseq>=' +5707 '<content>' +5708 '<relation>=</relation>' +5709 '</content>' +5710 '<children>' +5711 '<identifier>n</identifier>' +5712 '<number>0</number>' +5713 '</children>' +5714 '</relseq>' +5715