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 '<identifier>\u221E</identifier>' +5716 '</children>' +5717 '</limboth>' +5718 '<superscript>' +5719 '<children>' +5720 '<identifier>n</identifier>' +5721 '<number>2</number>' +5722 '</children>' +5723 '</superscript>' +5724 '</children>' +5725 '</bigop>');5726 this.executeTreeTest(5727 '<mrow><munderover><mi>\u2211</mi><mrow><mi>n</mi><mo>=</mo><mn>0</mn>' +5728 '</mrow><mi>\u221E</mi></munderover><munderover><mi>\u2211</mi><mrow>' +5729 '<mi>m</mi><mo>=</mo><mn>0</mn></mrow><mi>\u221E</mi></munderover><msup>' +5730 '<mi>n</mi><mn>m</mn></msup></mrow>',5731 '<bigop>' +5732 '<children>' +5733 '<limboth>' +5734 '<children>' +5735 '<largeop>\u2211</largeop>' +5736 '<relseq>=' +5737 '<content>' +5738 '<relation>=</relation>' +5739 '</content>' +5740 '<children>' +5741 '<identifier>n</identifier>' +5742 '<number>0</number>' +5743 '</children>' +5744 '</relseq>' +5745 '<identifier>\u221E</identifier>' +5746 '</children>' +5747 '</limboth>' +5748 '<bigop>' +5749 '<children>' +5750 '<limboth>' +5751 '<children>' +5752 '<largeop>\u2211</largeop>' +5753 '<relseq>=' +5754 '<content>' +5755 '<relation>=</relation>' +5756 '</content>' +5757 '<children>' +5758 '<identifier>m</identifier>' +5759 '<number>0</number>' +5760 '</children>' +5761 '</relseq>' +5762 '<identifier>\u221E</identifier>' +5763 '</children>' +5764 '</limboth>' +5765 '<superscript>' +5766 '<children>' +5767 '<identifier>n</identifier>' +5768 '<identifier>m</identifier>' +5769 '</children>' +5770 '</superscript>' +5771 '</children>' +5772 '</bigop>' +5773 '</children>' +5774 '</bigop>');5775 this.executeTreeTest(5776 '<mrow><munder><mi>\u2211</mi><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow>' +5777 '</munder><msup><mi>n</mi><mn>2</mn></msup></mrow>',5778 '<bigop>' +5779 '<children>' +5780 '<limlower>' +5781 '<children>' +5782 '<largeop>\u2211</largeop>' +5783 '<relseq>=' +5784 '<content>' +5785 '<relation>=</relation>' +5786 '</content>' +5787 '<children>' +5788 '<identifier>n</identifier>' +5789 '<number>0</number>' +5790 '</children>' +5791 '</relseq>' +5792 '</children>' +5793 '</limlower>' +5794 '<superscript>' +5795 '<children>' +5796 '<identifier>n</identifier>' +5797 '<number>2</number>' +5798 '</children>' +5799 '</superscript>' +5800 '</children>' +5801 '</bigop>');5802});5803/**5804 * Variations of integrals.5805 */5806TEST_F('CvoxSemanticTreeUnitTest', 'StreeIntegrals', function() {5807 this.brief = true;5808 this.executeTreeTest(5809 '<mi>\u222B</mi>',5810 '<largeop>\u222B</largeop>');5811 this.executeTreeTest(5812 '<mi>\u222B</mi><mi>dx</mi>',5813 '<integral>' +5814 '<children>' +5815 '<largeop>\u222B</largeop>' +5816 '<empty/>' +5817 '<identifier>dx</identifier>' +5818 '</children>' +5819 '</integral>');5820 this.executeTreeTest(5821 '<mrow><mi>\u222B</mi><mi>x</mi><mi>dx</mi></mrow>',5822 '<integral>' +5823 '<children>' +5824 '<largeop>\u222B</largeop>' +5825 '<identifier>x</identifier>' +5826 '<identifier>dx</identifier>' +5827 '</children>' +5828 '</integral>');5829 this.executeTreeTest(5830 '<mrow><mi>\u222B</mi><mi>x</mi><mi>d</mi><mi>x</mi></mrow>',5831 '<integral>' +5832 '<children>' +5833 '<largeop>\u222B</largeop>' +5834 '<identifier>x</identifier>' +5835 '<punctuated>' +5836 '<content>' +5837 '<punctuation>\u2063</punctuation>' +5838 '</content>' +5839 '<children>' +5840 '<identifier>d</identifier>' +5841 '<punctuation>\u2063</punctuation>' +5842 '<identifier>x</identifier>' +5843 '</children>' +5844 '</punctuated>' +5845 '</children>' +5846 '</integral>');5847 this.executeTreeTest(5848 '<mrow><mi>\u222B</mi><mi>x</mi><mo>+' +5849 '</mo><mi>y</mi><mi>d</mi><mi>x</mi></mrow>',5850 '<integral>' +5851 '<children>' +5852 '<largeop>\u222B</largeop>' +5853 '<infixop>+' +5854 '<content>' +5855 '<operator>+</operator>' +5856 '</content>' +5857 '<children>' +5858 '<identifier>x</identifier>' +5859 '<identifier>y</identifier>' +5860 '</children>' +5861 '</infixop>' +5862 '<punctuated>' +5863 '<content>' +5864 '<punctuation>\u2063</punctuation>' +5865 '</content>' +5866 '<children>' +5867 '<identifier>d</identifier>' +5868 '<punctuation>\u2063</punctuation>' +5869 '<identifier>x</identifier>' +5870 '</children>' +5871 '</punctuated>' +5872 '</children>' +5873 '</integral>');5874 this.executeTreeTest(5875 '<munderover><mi>\u222B</mi><mn>0</mn><mn>10</mn></munderover>',5876 '<limboth>' +5877 '<children>' +5878 '<largeop>\u222B</largeop>' +5879 '<number>0</number>' +5880 '<number>10</number>' +5881 '</children>' +5882 '</limboth>');5883 this.executeTreeTest(5884 '<munder><mi>\u222B</mi><mn>X</mn></munder>',5885 '<limlower>' +5886 '<children>' +5887 '<largeop>\u222B</largeop>' +5888 '<identifier>X</identifier>' +5889 '</children>' +5890 '</limlower>');5891 this.executeTreeTest(5892 '<munderover><mi>\u222B</mi><mn>0</mn><mn>10</mn></munderover><mi>x</mi>' +5893 '<mi>d</mi><mi>x</mi>',5894 '<integral>' +5895 '<children>' +5896 '<limboth>' +5897 '<children>' +5898 '<largeop>\u222B</largeop>' +5899 '<number>0</number>' +5900 '<number>10</number>' +5901 '</children>' +5902 '</limboth>' +5903 '<identifier>x</identifier>' +5904 '<punctuated>' +5905 '<content>' +5906 '<punctuation>\u2063</punctuation>' +5907 '</content>' +5908 '<children>' +5909 '<identifier>d</identifier>' +5910 '<punctuation>\u2063</punctuation>' +5911 '<identifier>x</identifier>' +5912 '</children>' +5913 '</punctuated>' +5914 '</children>' +5915 '</integral>');5916 this.executeTreeTest(5917 '<munder><mi>\u222B</mi><mn>X</mn></munder><mi>x</mi><mi>dx</mi>',5918 '<integral>' +5919 '<children>' +5920 '<limlower>' +5921 '<children>' +5922 '<largeop>\u222B</largeop>' +5923 '<identifier>X</identifier>' +5924 '</children>' +5925 '</limlower>' +5926 '<identifier>x</identifier>' +5927 '<identifier>dx</identifier>' +5928 '</children>' +5929 '</integral>');5930 this.executeTreeTest(5931 '<munderover><mi>\u222B</mi><mn>0</mn><mn>10</mn></munderover><mi>x</mi>' +5932 '<mi>dx</mi><mo>+</mo><munderover><mi>\u222B</mi><mn>10</mn><mn>20</mn>' +5933 '</munderover><mi>x</mi><mi>dx</mi><mo>=</mo><munderover><mi>\u222B</mi>' +5934 '<mn>0</mn><mn>20</mn></munderover><mi>x</mi><mi>dx</mi>',5935 '<relseq>=' +5936 '<content>' +5937 '<relation>=</relation>' +5938 '</content>' +5939 '<children>' +5940 '<infixop>+' +5941 '<content>' +5942 '<operator>+</operator>' +5943 '</content>' +5944 '<children>' +5945 '<integral>' +5946 '<children>' +5947 '<limboth>' +5948 '<children>' +5949 '<largeop>\u222B</largeop>' +5950 '<number>0</number>' +5951 '<number>10</number>' +5952 '</children>' +5953 '</limboth>' +5954 '<identifier>x</identifier>' +5955 '<identifier>dx</identifier>' +5956 '</children>' +5957 '</integral>' +5958 '<integral>' +5959 '<children>' +5960 '<limboth>' +5961 '<children>' +5962 '<largeop>\u222B</largeop>' +5963 '<number>10</number>' +5964 '<number>20</number>' +5965 '</children>' +5966 '</limboth>' +5967 '<identifier>x</identifier>' +5968 '<identifier>dx</identifier>' +5969 '</children>' +5970 '</integral>' +5971 '</children>' +5972 '</infixop>' +5973 '<integral>' +5974 '<children>' +5975 '<limboth>' +5976 '<children>' +5977 '<largeop>\u222B</largeop>' +5978 '<number>0</number>' +5979 '<number>20</number>' +5980 '</children>' +5981 '</limboth>' +5982 '<identifier>x</identifier>' +5983 '<identifier>dx</identifier>' +5984 '</children>' +5985 '</integral>' +5986 '</children>' +5987 '</relseq>');5988 this.executeTreeTest(5989 '<mi>\u222B</mi><mi>\u222B</mi><mi>\u222B</mi>' +5990 '<mi>dx</mi><mi>dy</mi><mi>dz</mi>',5991 '<integral>' +5992 '<children>' +5993 '<largeop>\u222B</largeop>' +5994 '<integral>' +5995 '<children>' +5996 '<largeop>\u222B</largeop>' +5997 '<integral>' +5998 '<children>' +5999 '<largeop>\u222B</largeop>' +6000 '<empty/>' +6001 '<identifier>dx</identifier>' +6002 '</children>' +6003 '</integral>' +6004 '<identifier>dy</identifier>' +6005 '</children>' +6006 '</integral>' +6007 '<identifier>dz</identifier>' +6008 '</children>' +6009 '</integral>');...

Full Screen

Full Screen

MailChimpAPI_v1_3.js

Source:MailChimpAPI_v1_3.js Github

copy

Full Screen

...85 * @see http://www.mailchimp.com/api/1.3/campaigncontent.func.php86 */87MailChimpAPI_v1_3.prototype.campaignContent = function (params, callback) {88 if (typeof params == 'function') callback = params, params = {};89 this.execute('campaignContent', [90 'cid', 91 'for_archive',92 ], params, callback);93}94/**95 * Create a new draft campaign to send. You can not have more than 32,000 96 * campaigns in your account.97 * 98 * @see http://www.mailchimp.com/api/1.3/campaigncreate.func.php99 */100MailChimpAPI_v1_3.prototype.campaignCreate = function (params, callback) {101 if (typeof params == 'function') callback = params, params = {};102 this.execute('campaignCreate', [103 'type',104 'options',105 'content',106 'segment_opts',107 'type_opts',108 ], params, callback);109}110/**111 * Delete a campaign. Seriously, "poof, gone!" - be careful!112 * 113 * @see http://www.mailchimp.com/api/1.3/campaigndelete.func.php114 */115MailChimpAPI_v1_3.prototype.campaignDelete = function (params, callback) {116 if (typeof params == 'function') callback = params, params = {};117 this.execute('campaignDelete', [118 'cid',119 ], params, callback);120}121/**122 * Attach Ecommerce Order Information to a Campaign. This will generall be used123 * by ecommerce package plugins that MailChimp provides or by 3rd part system 124 * developers.125 * 126 * @see http://www.mailchimp.com/api/1.3/campaignecommorderadd.func.php127 */128MailChimpAPI_v1_3.prototype.campaignEcommOrderAdd = function (params, callback) {129 if (typeof params == 'function') callback = params, params = {};130 this.execute('campaignEcommOrderAdd', [131 'order',132 ], params, callback);133}134/**135 * Pause an AutoResponder or RSS campaign from sending.136 * 137 * @see http://www.mailchimp.com/api/1.3/campaignpause.func.php138 */139MailChimpAPI_v1_3.prototype.campaignPause = function (params, callback) {140 if (typeof params == 'function') callback = params, params = {};141 this.execute('campaignPause', [142 'cid',143 ], params, callback);144}145/**146 * Replicate a campaign.147 * 148 * @see http://www.mailchimp.com/api/1.3/campaignreplicate.func.php149 */150MailChimpAPI_v1_3.prototype.campaignReplicate = function (params, callback) {151 if (typeof params == 'function') callback = params, params = {};152 this.execute('campaignReplicate', [153 'cid',154 ], params, callback);155}156/**157 * Resume sending an AutoResponder or RSS campaign.158 * 159 * @see http://www.mailchimp.com/api/1.3/campaignresume.func.php160 */161MailChimpAPI_v1_3.prototype.campaignResume = function (params, callback) {162 if (typeof params == 'function') callback = params, params = {};163 this.execute('campaignResume', [164 'cid',165 ], params, callback);166}167/**168 * Schedule a campaign to be sent in the future.169 * 170 * @see http://www.mailchimp.com/api/1.3/campaignschedule.func.php171 */172MailChimpAPI_v1_3.prototype.campaignSchedule = function (params, callback) {173 if (typeof params == 'function') callback = params, params = {};174 this.execute('campaignSchedule', [175 'cid',176 'schedule_time',177 'schedule_time_b',178 ], params, callback);179}180/**181 * Allows one to test their segmentation rules before creating a campaign using182 * them.183 * 184 * @see http://www.mailchimp.com/api/1.3/campaignsegmenttest.func.php185 */186MailChimpAPI_v1_3.prototype.campaignSegmentTest = function (params, callback) {187 if (typeof params == 'function') callback = params, params = {};188 this.execute('campaignSegmentTest', [189 'list_id',190 'options',191 ], params, callback);192}193/**194 * Send a given campaign immediately. For RSS campaigns, this will "start" 195 * them.196 * 197 * @see http://www.mailchimp.com/api/1.3/campaignsendnow.func.php198 */199MailChimpAPI_v1_3.prototype.campaignSendNow = function (params, callback) {200 if (typeof params == 'function') callback = params, params = {};201 this.execute('campaignSendNow', [202 'cid',203 ], params, callback);204}205/**206 * Send a test of this campaign to the provided email address.207 * 208 * @see http://www.mailchimp.com/api/1.3/campaignsendtest.func.php209 */210MailChimpAPI_v1_3.prototype.campaignSendTest = function (params, callback) {211 if (typeof params == 'function') callback = params, params = {};212 this.execute('campaignSendTest', [213 'cid',214 'test_emails',215 'send_type',216 ], params, callback);217}218/**219 * Get the URL to a customized VIP Report for the specified campaign and220 * optionally send an email to someone with links to it.221 * 222 * @see http://www.mailchimp.com/api/1.3/campaignsharereport.func.php223 */224MailChimpAPI_v1_3.prototype.campaignShareReport = function (params, callback) {225 if (typeof params == 'function') callback = params, params = {};226 this.execute('campaignShareReport', [227 'cid',228 'opts',229 ], params, callback);230}231/**232 * Get the HTML template content sections for a campaign. Note that this will233 * return very jagged, non-standard results based on the template a campaign is234 * using. You only want to use this if you want to allow editing template235 * sections in your applicaton.236 * 237 * @see http://www.mailchimp.com/api/1.3/campaigntemplatecontent.func.php238 */239MailChimpAPI_v1_3.prototype.campaignTemplateContent = function (params, callback) {240 if (typeof params == 'function') callback = params, params = {};241 this.execute('campaignTemplateContent', [242 'cid',243 ], params, callback);244}245/**246 * Unschedule a campaign that is scheduled to be sent in the future.247 * 248 * @see http://www.mailchimp.com/api/1.3/campaignunschedule.func.php249 */250MailChimpAPI_v1_3.prototype.campaignUnschedule = function (params, callback) {251 if (typeof params == 'function') callback = params, params = {};252 this.execute('campaignUnschedule', [253 'cid',254 ], params, callback);255}256/**257 * Update just about any setting for a campaign that has not been sent. See 258 * campaignCreate() for details.259 * 260 * @see http://www.mailchimp.com/api/1.3/campaignupdate.func.php261 */262MailChimpAPI_v1_3.prototype.campaignUpdate = function (params, callback) {263 if (typeof params == 'function') callback = params, params = {};264 this.execute('campaignUpdate', [265 'cid',266 'name',267 'value',268 ], params, callback);269}270/**271 * Get the list of campaigns and their details matching the specified filters.272 * 273 * @see http://www.mailchimp.com/api/1.3/campaigns.func.php274 */275MailChimpAPI_v1_3.prototype.campaigns = function (params, callback) {276 if (typeof params == 'function') callback = params, params = {};277 this.execute('campaigns', [278 'filters',279 'start',280 'limit',281 ], params, callback);282}283/*****************************************************************************/284/************************** Campaign Stats Methods ***************************/285/*****************************************************************************/286/**287 * Get all email addresses that complained about a given campaign.288 * 289 * @see http://www.mailchimp.com/api/1.3/campaignabusereports.func.php290 */291MailChimpAPI_v1_3.prototype.campaignAbuseReports = function (params, callback) {292 if (typeof params == 'function') callback = params, params = {};293 this.execute('campaignAbuseReports', [294 'cid',295 'since',296 'start',297 'limit',298 ], params, callback);299}300/**301 * Retrieve the text presented in the MailChimp app for how a campaign302 * performed and any advice MailChimp may have for you - best suited for 303 * display in customized reports pages.304 * 305 * @see http://www.mailchimp.com/api/1.3/campaignadvice.func.php306 */307MailChimpAPI_v1_3.prototype.campaignAdvice = function (params, callback) {308 if (typeof params == 'function') callback = params, params = {};309 this.execute('campaignAdvice', [310 'cid',311 ], params, callback);312}313/**314 * Retrieve the Google Analytics data MailChimp has collected for this 315 * campaign.316 * 317 * @see http://www.mailchimp.com/api/1.3/campaignanalytics.func.php318 */319MailChimpAPI_v1_3.prototype.campaignAnalytics = function (params, callback) {320 if (typeof params == 'function') callback = params, params = {};321 this.execute('campaignAnalytics', [322 'cid',323 ], params, callback);324}325/**326 * Retrieve the most recent full bounce message for a specific email address327 * on the given campaign.328 * 329 * @see http://www.mailchimp.com/api/1.3/campaignbouncemessage.func.php330 */331MailChimpAPI_v1_3.prototype.campaignBounceMessage = function (params, callback) {332 if (typeof params == 'function') callback = params, params = {};333 this.execute('campaignBounceMessage', [334 'cid',335 'email',336 ], params, callback);337}338/**339 * Retrieve the full bounce messages for the given campaign.340 * 341 * @see http://www.mailchimp.com/api/1.3/campaignbouncemessages.func.php342 */343MailChimpAPI_v1_3.prototype.campaignBounceMessages = function (params, callback) {344 if (typeof params == 'function') callback = params, params = {};345 this.execute('campaignBounceMessages', [346 'cid',347 'start',348 'limit',349 'since',350 ], params, callback);351}352/**353 * Get an array of the urls being tracked, and their click counts for a given 354 * campaign.355 * 356 * @see http://www.mailchimp.com/api/1.3/campaignclickstats.func.php357 */358MailChimpAPI_v1_3.prototype.campaignClickStats = function (params, callback) {359 if (typeof params == 'function') callback = params, params = {};360 this.execute('campaignClickStats', [361 'cid',362 ], params, callback);363}364/**365 * Retrieve the Ecommerce Orders tracked by campaignEcommOrderAdd().366 * 367 * @see http://www.mailchimp.com/api/1.3/campaignecommorders.func.php368 */369MailChimpAPI_v1_3.prototype.campaignEcommOrders = function (params, callback) {370 if (typeof params == 'function') callback = params, params = {};371 this.execute('campaignEcommOrders', [372 'cid',373 'start',374 'limit',375 'since',376 ], params, callback);377}378/**379 * Retrieve the tracked eepurl mentions on Twitter.380 * 381 * @see http://www.mailchimp.com/api/1.3/campaigneepurlstats.func.php382 */383MailChimpAPI_v1_3.prototype.campaignEepUrlStats = function (params, callback) {384 if (typeof params == 'function') callback = params, params = {};385 this.execute('campaignEepUrlStats', [386 'cid',387 ], params, callback);388}389/**390 * Get the top 5 performing email domains for this campaign.391 * 392 * @see http://www.mailchimp.com/api/1.3/campaignemaildomainperformance.func.php393 */394MailChimpAPI_v1_3.prototype.campaignEmailDomainPerformance = function (params, callback) {395 if (typeof params == 'function') callback = params, params = {};396 this.execute('campaignEmailDomainPerformance', [397 'cid',398 ], params, callback);399}400/**401 * Retrieve the countries and number of opens tracked for each.402 * 403 * @see http://www.mailchimp.com/api/1.3/campaigngeoopens.func.php404 */405MailChimpAPI_v1_3.prototype.campaignGeoOpens = function (params, callback) {406 if (typeof params == 'function') callback = params, params = {};407 this.execute('campaignGeoOpens', [408 'cid',409 ], params, callback);410}411/**412 * Retrieve the regions and number of opens tracked for a certain country.413 * 414 * @see http://www.mailchimp.com/api/1.3/campaigngeoopensforcountry.func.php415 */416MailChimpAPI_v1_3.prototype.campaignGeoOpensForCountry = function (params, callback) {417 if (typeof params == 'function') callback = params, params = {};418 this.execute('campaignGeoOpensForCountry', [419 'cid',420 'code',421 ], params, callback);422}423/**424 * @deprecated Get all email addresses with Hard Bounces for a given campaign.425 * 426 * @see http://www.mailchimp.com/api/1.3/campaignhardbounces.func.php427 */428MailChimpAPI_v1_3.prototype.campaignHardBounces = function (params, callback) {429 if (typeof params == 'function') callback = params, params = {};430 this.execute('campaignHardBounces', [431 'cid',432 'start',433 'limit',434 ], params, callback);435}436/**437 * Get all email addresses the campaign was successfully sent to (ie, no 438 * bounces).439 * 440 * @see http://www.mailchimp.com/api/1.3/campaignmembers.func.php441 */442MailChimpAPI_v1_3.prototype.campaignMembers = function (params, callback) {443 if (typeof params == 'function') callback = params, params = {};444 this.execute('campaignMembers', [445 'cid',446 'status',447 'start',448 'limit',449 ], params, callback);450}451/**452 * @deprecated Get all email addresses with Soft Bounces for a given campaign.453 * 454 * @see http://www.mailchimp.com/api/1.3/campaignsoftbounces.func.php455 */456MailChimpAPI_v1_3.prototype.campaignSoftBounces = function (params, callback) {457 if (typeof params == 'function') callback = params, params = {};458 this.execute('campaignSoftBounces', [459 'cid',460 'start',461 'limit',462 ], params, callback);463}464/**465 * Given a list and a campaign, get all the relevant campaign statistics466 * (opens, bounces, clicks, etc.).467 * 468 * @see http://www.mailchimp.com/api/1.3/campaignstats.func.php469 */470MailChimpAPI_v1_3.prototype.campaignStats = function (params, callback) {471 if (typeof params == 'function') callback = params, params = {};472 this.execute('campaignStats', [473 'cid',474 ], params, callback);475}476/**477 * Get all unsubscribed email addresses for a given campaign.478 * 479 * @see http://www.mailchimp.com/api/1.3/campaignunsubscribes.func.php480 */481MailChimpAPI_v1_3.prototype.campaignUnsubscribes = function (params, callback) {482 if (typeof params == 'function') callback = params, params = {};483 this.execute('campaignUnsubscribes', [484 'cid',485 'start',486 'limit',487 ], params, callback);488}489/*****************************************************************************/490/*********************** Campaign Report Data Methods ***********************/491/*****************************************************************************/492/**493 * Return the list of email addresses that clicked on a given url, and how many494 * times they clicked.495 * 496 * @see http://www.mailchimp.com/api/1.3/campaignclickdetailaim.func.php497 */498MailChimpAPI_v1_3.prototype.campaignClickDetailAIM = function (params, callback) {499 if (typeof params == 'function') callback = params, params = {};500 this.execute('campaignClickDetailAIM', [501 'cid',502 'url',503 'start',504 'limit',505 ], params, callback);506}507/**508 * Given a campaign and email address, return the entire click and open history509 * with timestamps, ordered by time.510 * 511 * @see http://www.mailchimp.com/api/1.3/campaignemailstatsaim.func.php512 */513MailChimpAPI_v1_3.prototype.campaignEmailStatsAIM = function (params, callback) {514 if (typeof params == 'function') callback = params, params = {};515 this.execute('campaignEmailStatsAIM', [516 'cid',517 'email_address',518 ], params, callback);519}520/**521 * Given a campaign and correct paging limits, return the entire click and open522 * history with timestamps, ordered by time, for every user a campaign was 523 * delivered to.524 * 525 * @see http://www.mailchimp.com/api/1.3/campaignemailstatsaimall.func.php526 */527MailChimpAPI_v1_3.prototype.campaignEmailStatsAIMAll = function (params, callback) {528 if (typeof params == 'function') callback = params, params = {};529 this.execute('campaignEmailStatsAIMAll', [530 'cid',531 'start',532 'limit',533 ], params, callback);534}535/**536 * Retrieve the list of email addresses that did not open a given campaign.537 * 538 * @see http://www.mailchimp.com/api/1.3/campaignnotopenedaim.func.php539 */540MailChimpAPI_v1_3.prototype.campaignNotOpenedAIM = function (params, callback) {541 if (typeof params == 'function') callback = params, params = {};542 this.execute('campaignNotOpenedAIM', [543 'cid',544 'start',545 'limit',546 ], params, callback);547}548/**549 * Retrieve the list of email addresses that opened a given campaign with how550 * many times they opened - note: this AIM function is free and does not 551 * actually require the AIM module to be installed.552 * 553 * @see http://www.mailchimp.com/api/1.3/campaignopenedaim.func.php554 */555MailChimpAPI_v1_3.prototype.campaignOpenedAIM = function (params, callback) {556 if (typeof params == 'function') callback = params, params = {};557 this.execute('campaignOpenedAIM', [558 'cid',559 'start',560 'limit',561 ], params, callback);562}563/*****************************************************************************/564/**************************** Ecommerce Methods *****************************/565/*****************************************************************************/566/**567 * Import Ecommerce Order Information to be used for Segmentation.568 * 569 * @see http://www.mailchimp.com/api/1.3/ecommorderadd.func.php570 */571MailChimpAPI_v1_3.prototype.ecommOrderAdd = function (params, callback) {572 if (typeof params == 'function') callback = params, params = {};573 this.execute('ecommOrderAdd', [574 'order',575 ], params, callback);576}577/**578 * Delete Ecommerce Order Information used for segmentation.579 * 580 * @see http://www.mailchimp.com/api/1.3/ecommorderdel.func.php581 */582MailChimpAPI_v1_3.prototype.ecommOrderDel = function (params, callback) {583 if (typeof params == 'function') callback = params, params = {};584 this.execute('ecommOrderDel', [585 'store_id',586 'order_id',587 ], params, callback);588}589/**590 * Retrieve the Ecommerce Orders for an account.591 * 592 * @see http://www.mailchimp.com/api/1.3/ecommorders.func.php593 */594MailChimpAPI_v1_3.prototype.ecommOrders = function (params, callback) {595 if (typeof params == 'function') callback = params, params = {};596 this.execute('ecommOrders', [597 'start',598 'limit',599 'since',600 ], params, callback);601}602/*****************************************************************************/603/************************** Folder Related Methods ***************************/604/*****************************************************************************/605/**606 * Add a new folder to file campaigns or autoresponders in.607 * 608 * @see http://www.mailchimp.com/api/1.3/folderadd.func.php609 */610MailChimpAPI_v1_3.prototype.folderAdd = function (params, callback) {611 if (typeof params == 'function') callback = params, params = {};612 this.execute('folderAdd', [613 'name',614 'type',615 ], params, callback);616}617/**618 * Delete a campaign or autoresponder folder.619 * 620 * @see http://www.mailchimp.com/api/1.3/folderdel.func.php621 */622MailChimpAPI_v1_3.prototype.folderDel = function (params, callback) {623 if (typeof params == 'function') callback = params, params = {};624 this.execute('folderDel', [625 'fid',626 'type',627 ], params, callback);628}629/**630 * Update the name of a folder for campaigns or autoresponders.631 * 632 * @see http://www.mailchimp.com/api/1.3/folderupdate.func.php633 */634MailChimpAPI_v1_3.prototype.folderUpdate = function (params, callback) {635 if (typeof params == 'function') callback = params, params = {};636 this.execute('folderUpdate', [637 'fid',638 'name',639 'type',640 ], params, callback);641}642/**643 * List all the folders for a user account.644 * 645 * @see http://www.mailchimp.com/api/1.3/folders.func.php646 */647MailChimpAPI_v1_3.prototype.folders = function (params, callback) {648 if (typeof params == 'function') callback = params, params = {};649 this.execute('folders', [650 'type',651 ], params, callback);652}653/*****************************************************************************/654/****************************** Helper Methods *******************************/655/*****************************************************************************/656/**657 * Retrieve all Campaigns Ids a member was sent.658 * 659 * @see http://www.mailchimp.com/api/1.3/campaignsforemail.func.php660 */661MailChimpAPI_v1_3.prototype.campaignsForEmail = function (params, callback) {662 if (typeof params == 'function') callback = params, params = {};663 this.execute('campaignsForEmail', [664 'email_address',665 ], params, callback);666}667/**668 * Return the current Chimp Chatter messages for an account.669 * 670 * @see http://www.mailchimp.com/api/1.3/chimpchatter.func.php671 */672MailChimpAPI_v1_3.prototype.chimpChatter = function (params, callback) {673 if (typeof params == 'function') callback = params, params = {};674 this.execute('chimpChatter', [675 ], params, callback);676}677/**678 * Have HTML content auto-converted to a text-only format.679 * 680 * @see http://www.mailchimp.com/api/1.3/generatetext.func.php681 */682MailChimpAPI_v1_3.prototype.generateText = function (params, callback) {683 if (typeof params == 'function') callback = params, params = {};684 this.execute('generateText', [685 'type',686 'content',687 ], params, callback);688}689/**690 * Retrieve lots of account information including payments made, plan info, 691 * some account stats, installed modules, contact info, and more.692 * 693 * @see http://www.mailchimp.com/api/1.3/getaccountdetails.func.php694 */695MailChimpAPI_v1_3.prototype.getAccountDetails = function (params, callback) {696 if (typeof params == 'function') callback = params, params = {};697 this.execute('getAccountDetails', [698 ], params, callback);699}700/**701 * Send your HTML content to have the CSS inlined and optionally remove the702 * original styles.703 * 704 * @see http://www.mailchimp.com/api/1.3/inlinecss.func.php705 */706MailChimpAPI_v1_3.prototype.inlineCss = function (params, callback) {707 if (typeof params == 'function') callback = params, params = {};708 this.execute('inlineCss', [709 'html',710 'strip_css',711 ], params, callback);712}713/**714 * Retrieve all List Ids a member is subscribed to.715 * 716 * @see http://www.mailchimp.com/api/1.3/listsforemail.func.php717 */718MailChimpAPI_v1_3.prototype.listsForEmail = function (params, callback) {719 if (typeof params == 'function') callback = params, params = {};720 this.execute('listsForEmail', [721 'email_address',722 ], params, callback);723}724/**725 * "Ping" the MailChimp API - a simple method you can call that will return a726 * constant value as long as everything is good.727 * 728 * @see http://www.mailchimp.com/api/1.3/ping.func.php729 */730MailChimpAPI_v1_3.prototype.ping = function (params, callback) {731 if (typeof params == 'function') callback = params, params = {};732 this.execute('ping', [733 ], params, callback);734}735/**736 * Search all campaigns for the specified query terms.737 *738 * @see http://apidocs.mailchimp.com/api/1.3/searchcampaigns.func.php739 */740MailChimpAPI_v1_3.prototype.searchCampaigns = function (params, callback) {741 if (typeof params == 'function') callback = params, params = {};742 this.execute('searchCampaigns', [743 'query',744 'offset',745 'snip_start',746 'snip_end',747 ], params, callback);748}749/**750 * Search account wide or on a specific list using the specified query terms.751 *752 * @see http://apidocs.mailchimp.com/api/1.3/searchmembers.func.php753 */754MailChimpAPI_v1_3.prototype.searchMembers = function (params, callback) {755 if (typeof params == 'function') callback = params, params = {};756 this.execute('searchMembers', [757 'query',758 'id',759 'offset',760 ], params, callback);761}762/*****************************************************************************/763/*************************** List Related Methods ****************************/764/*****************************************************************************/765/**766 * Get all email addresses that complained about a given campaign.767 * 768 * @see http://www.mailchimp.com/api/1.3/listabusereports.func.php769 */770MailChimpAPI_v1_3.prototype.listAbuseReports = function (params, callback) {771 if (typeof params == 'function') callback = params, params = {};772 this.execute('listAbuseReports', [773 'id',774 'start',775 'limit',776 'since',777 ], params, callback);778}779/**780 * Access up to the previous 180 days of daily detailed aggregated activity 781 * stats for a given list.782 * 783 * @see http://www.mailchimp.com/api/1.3/listactivity.func.php784 */785MailChimpAPI_v1_3.prototype.listActivity = function (params, callback) {786 if (typeof params == 'function') callback = params, params = {};787 this.execute('listActivity', [788 'id',789 ], params, callback);790}791/**792 * Subscribe a batch of email addresses to a list at once.793 * 794 * @see http://www.mailchimp.com/api/1.3/listbatchsubscribe.func.php795 */796MailChimpAPI_v1_3.prototype.listBatchSubscribe = function (params, callback) {797 if (typeof params == 'function') callback = params, params = {};798 this.execute('listBatchSubscribe', [799 'id',800 'batch',801 'double_optin',802 'update_existing',803 'replace_interests',804 ], params, callback);805}806/**807 * Unsubscribe a batch of email addresses to a list.808 * 809 * @see http://www.mailchimp.com/api/1.3/listbatchunsubscribe.func.php810 */811MailChimpAPI_v1_3.prototype.listBatchUnsubscribe = function (params, callback) {812 if (typeof params == 'function') callback = params, params = {};813 this.execute('listBatchUnsubscribe', [814 'id',815 'emails',816 'delete_member',817 'send_goodbye',818 'send_notify',819 ], params, callback);820}821/**822 * Retrieve the clients that the list's subscribers have been tagged as being823 * used based on user agents seen.824 * 825 * @see http://www.mailchimp.com/api/1.3/listclients.func.php826 */827MailChimpAPI_v1_3.prototype.listClients = function (params, callback) {828 if (typeof params == 'function') callback = params, params = {};829 this.execute('listClients', [830 'id',831 ], params, callback);832}833/**834 * Access the Growth History by Month for a given list.835 * 836 * @see http://www.mailchimp.com/api/1.3/listgrowthhistory.func.php837 */838MailChimpAPI_v1_3.prototype.listGrowthHistory = function (params, callback) {839 if (typeof params == 'function') callback = params, params = {};840 this.execute('listGrowthHistory', [841 'id',842 ], params, callback);843}844/**845 * Add a single Interest Group - if interest groups for the List are not yet846 * enabled, adding the first group will automatically turn them on.847 * 848 * @see http://www.mailchimp.com/api/1.3/listinterestgroupadd.func.php849 */850MailChimpAPI_v1_3.prototype.listInterestGroupAdd = function (params, callback) {851 if (typeof params == 'function') callback = params, params = {};852 this.execute('listInterestGroupAdd', [853 'id',854 'group_name',855 'grouping_id',856 'optional',857 ], params, callback);858}859/**860 * Delete a single Interest Group - if the last group for a list is deleted, 861 * this will also turn groups for the list off.862 * 863 * @see http://www.mailchimp.com/api/1.3/listinterestgroupdel.func.php864 */865MailChimpAPI_v1_3.prototype.listInterestGroupDel = function (params, callback) {866 if (typeof params == 'function') callback = params, params = {};867 this.execute('listInterestGroupDel', [868 'id',869 'group_name',870 'grouping_id',871 ], params, callback);872}873/**874 * Change the name of an Interest Group.875 * 876 * @see http://www.mailchimp.com/api/1.3/listinterestgroupupdate.func.php877 */878MailChimpAPI_v1_3.prototype.listInterestGroupUpdate = function (params, callback) {879 if (typeof params == 'function') callback = params, params = {};880 this.execute('listInterestGroupUpdate', [881 'id',882 'old_name',883 'new_name',884 'grouping_id',885 'optional',886 ], params, callback);887}888/**889 * Add a new Interest Grouping - if interest groups for the List are not yet890 * enabled, adding the first grouping will automatically turn them on.891 * 892 * @see http://www.mailchimp.com/api/1.3/listinterestgroupingadd.func.php893 */894MailChimpAPI_v1_3.prototype.listInterestGroupingAdd = function (params, callback) {895 if (typeof params == 'function') callback = params, params = {};896 this.execute('listInterestGroupingAdd', [897 'id',898 'name',899 'type',900 'groups',901 ], params, callback);902}903/**904 * Delete an existing Interest Grouping - this will permanently delete all905 * contained interest groups and will remove those selections from all list 906 * members.907 * 908 * @see http://www.mailchimp.com/api/1.3/listinterestgroupingdel.func.php909 */910MailChimpAPI_v1_3.prototype.listInterestGroupingDel = function (params, callback) {911 if (typeof params == 'function') callback = params, params = {};912 this.execute('listInterestGroupingDel', [913 'grouping_id',914 ], params, callback);915}916/**917 * Update an existing Interest Grouping.918 * 919 * @see http://www.mailchimp.com/api/1.3/listinterestgroupingupdate.func.php920 */921MailChimpAPI_v1_3.prototype.listInterestGroupingUpdate = function (params, callback) {922 if (typeof params == 'function') callback = params, params = {};923 this.execute('listInterestGroupingUpdate', [924 'grouping_id',925 'name',926 'value',927 ], params, callback);928}929/**930 * Get the list of interest groupings for a given list, including the label,931 * form information, and included groups for each.932 * 933 * @see http://www.mailchimp.com/api/1.3/listinterestgroupings.func.php934 */935MailChimpAPI_v1_3.prototype.listInterestGroupings = function (params, callback) {936 if (typeof params == 'function') callback = params, params = {};937 this.execute('listInterestGroupings', [938 'id',939 ], params, callback);940}941/**942 * Retrieve the locations (countries) that the list's subscribers have been943 * tagged to based on geocoding their IP address.944 * 945 * @see http://www.mailchimp.com/api/1.3/listlocations.func.php946 */947MailChimpAPI_v1_3.prototype.listLocations = function (params, callback) {948 if (typeof params == 'function') callback = params, params = {};949 this.execute('listLocations', [950 'id',951 ], params, callback);952}953/**954 * Get the most recent 100 activities for particular list members (open, click,955 * bounce, unsub, abuse, sent to).956 * 957 * @see http://www.mailchimp.com/api/1.3/listmemberactivity.func.php958 */959MailChimpAPI_v1_3.prototype.listMemberActivity = function (params, callback) {960 if (typeof params == 'function') callback = params, params = {};961 this.execute('listMemberActivity', [962 'id',963 'email_address',964 ], params, callback);965}966/**967 * Get all the information for particular members of a list.968 * 969 * @see http://www.mailchimp.com/api/1.3/listmemberinfo.func.php970 */971MailChimpAPI_v1_3.prototype.listMemberInfo = function (params, callback) {972 if (typeof params == 'function') callback = params, params = {};973 this.execute('listMemberInfo', [974 'id',975 'email_address',976 ], params, callback);977}978/**979 * Get all of the list members for a list that are of a particular status.980 * 981 * @see http://www.mailchimp.com/api/1.3/listmembers.func.php982 */983MailChimpAPI_v1_3.prototype.listMembers = function (params, callback) {984 if (typeof params == 'function') callback = params, params = {};985 this.execute('listMembers', [986 'id',987 'status',988 'since',989 'start',990 'limit',991 ], params, callback);992}993/**994 * Add a new merge tag to a given list.995 * 996 * @see http://www.mailchimp.com/api/1.3/listmergevaradd.func.php997 */998MailChimpAPI_v1_3.prototype.listMergeVarAdd = function (params, callback) {999 if (typeof params == 'function') callback = params, params = {};1000 this.execute('listMergeVarAdd', [1001 'id',1002 'tag',1003 'name',1004 'options',1005 ], params, callback);1006}1007/**1008 * Delete a merge tag from a given list and all its members.1009 * 1010 * @see http://www.mailchimp.com/api/1.3/listmergevardel.func.php1011 */1012MailChimpAPI_v1_3.prototype.listMergeVarDel = function (params, callback) {1013 if (typeof params == 'function') callback = params, params = {};1014 this.execute('listMergeVarDel', [1015 'id',1016 'tag',1017 ], params, callback);1018}1019/**1020 * Update most parameters for a merge tag on a given list.1021 * 1022 * @see http://www.mailchimp.com/api/1.3/listmergevarupdate.func.php1023 */1024MailChimpAPI_v1_3.prototype.listMergeVarUpdate = function (params, callback) {1025 if (typeof params == 'function') callback = params, params = {};1026 this.execute('listMergeVarUpdate', [1027 'id',1028 'tag',1029 'options',1030 ], params, callback);1031}1032/**1033 * Get the list of merge tags for a given list, including their name, tag, and1034 * required setting.1035 * 1036 * @see http://www.mailchimp.com/api/1.3/listmergevars.func.php1037 */1038MailChimpAPI_v1_3.prototype.listMergeVars = function (params, callback) {1039 if (typeof params == 'function') callback = params, params = {};1040 this.execute('listMergeVars', [1041 'id',1042 ], params, callback);1043}1044/**1045 * Save a segment against a list for later use.1046 * 1047 * @see http://www.mailchimp.com/api/1.3/liststaticsegmentadd.func.php1048 */1049MailChimpAPI_v1_3.prototype.listStaticSegmentAdd = function (params, callback) {1050 if (typeof params == 'function') callback = params, params = {};1051 this.execute('listStaticSegmentAdd', [1052 'id',1053 'name',1054 ], params, callback);1055}1056/**1057 * Delete a static segment.1058 * 1059 * @see http://www.mailchimp.com/api/1.3/liststaticsegmentdel.func.php1060 */1061MailChimpAPI_v1_3.prototype.listStaticSegmentDel = function (params, callback) {1062 if (typeof params == 'function') callback = params, params = {};1063 this.execute('listStaticSegmentDel', [1064 'id',1065 'seg_id',1066 ], params, callback);1067}1068/**1069 * Add list members to a static segment.1070 * 1071 * @see http://www.mailchimp.com/api/1.3/liststaticsegmentmembersadd.func.php1072 */1073MailChimpAPI_v1_3.prototype.listStaticSegmentMembersAdd = function (params, callback) {1074 if (typeof params == 'function') callback = params, params = {};1075 this.execute('listStaticSegmentMembersAdd', [1076 'id',1077 'seg_id',1078 'batch',1079 ], params, callback);1080}1081/**1082 * Remove list members from a static segment.1083 * 1084 * @see http://www.mailchimp.com/api/1.3/liststaticsegmentmembersdel.func.php1085 */1086MailChimpAPI_v1_3.prototype.listStaticSegmentMembersDel = function (params, callback) {1087 if (typeof params == 'function') callback = params, params = {};1088 this.execute('listStaticSegmentMembersDel', [1089 'id',1090 'seg_id',1091 'batch',1092 ], params, callback);1093}1094/**1095 * Resets a static segment - removes all members from the static segment.1096 * 1097 * @see http://www.mailchimp.com/api/1.3/liststaticsegmentreset.func.php1098 */1099MailChimpAPI_v1_3.prototype.listStaticSegmentReset = function (params, callback) {1100 if (typeof params == 'function') callback = params, params = {};1101 this.execute('listStaticSegmentReset', [1102 'id',1103 'seg_id',1104 ], params, callback);1105}1106/**1107 * Retrieve all of the Static Segments for a list.1108 * 1109 * @see http://www.mailchimp.com/api/1.3/liststaticsegments.func.php1110 */1111MailChimpAPI_v1_3.prototype.listStaticSegments = function (params, callback) {1112 if (typeof params == 'function') callback = params, params = {};1113 this.execute('listStaticSegments', [1114 'id',1115 ], params, callback);1116}1117/**1118 * Subscribe the provided email to a list.1119 * 1120 * @see http://www.mailchimp.com/api/1.3/listsubscribe.func.php1121 */1122MailChimpAPI_v1_3.prototype.listSubscribe = function (params, callback) {1123 if (typeof params == 'function') callback = params, params = {};1124 this.execute('listSubscribe', [1125 'id',1126 'email_address',1127 'merge_vars',1128 'email_type',1129 'double_optin',1130 'update_existing',1131 'replace_interests',1132 'send_welcome',1133 ], params, callback);1134}1135/**1136 * Unsubscribe the given email address from the list.1137 * 1138 * @see http://www.mailchimp.com/api/1.3/listunsubscribe.func.php1139 */1140MailChimpAPI_v1_3.prototype.listUnsubscribe = function (params, callback) {1141 if (typeof params == 'function') callback = params, params = {};1142 this.execute('listUnsubscribe', [1143 'id',1144 'email_address',1145 'delete_member',1146 'send_goodbye',1147 'send_notify',1148 ], params, callback);1149}1150/**1151 * Edit the email address, merge fields, and interest groups for a list member.1152 * 1153 * @see http://www.mailchimp.com/api/1.3/listupdatemember.func.php1154 */1155MailChimpAPI_v1_3.prototype.listUpdateMember = function (params, callback) {1156 if (typeof params == 'function') callback = params, params = {};1157 this.execute('listUpdateMember', [1158 'id',1159 'email_address',1160 'merge_vars',1161 'email_type',1162 'replace_interests',1163 ], params, callback);1164}1165/**1166 * Add a new Webhook URL for the given list.1167 * 1168 * @see http://www.mailchimp.com/api/1.3/listwebhookadd.func.php1169 */1170MailChimpAPI_v1_3.prototype.listWebhookAdd = function (params, callback) {1171 if (typeof params == 'function') callback = params, params = {};1172 this.execute('listWebhookAdd', [1173 'id',1174 'url',1175 'actions',1176 'sources',1177 ], params, callback);1178}1179/**1180 * Delete an existing Webhook URL from a given list.1181 * 1182 * @see http://www.mailchimp.com/api/1.3/listwebhookdel.func.php1183 */1184MailChimpAPI_v1_3.prototype.listWebhookDel = function (params, callback) {1185 if (typeof params == 'function') callback = params, params = {};1186 this.execute('listWebhookDel', [1187 'id',1188 'url',1189 ], params, callback);1190}1191/**1192 * Return the Webhooks configured for the given list.1193 * 1194 * @see http://www.mailchimp.com/api/1.3/listwebhooks.func.php1195 */1196MailChimpAPI_v1_3.prototype.listWebhooks = function (params, callback) {1197 if (typeof params == 'function') callback = params, params = {};1198 this.execute('listWebhooks', [1199 'id',1200 ], params, callback);1201}1202/**1203 * Retrieve all of the lists defined for your user account.1204 * 1205 * @see http://www.mailchimp.com/api/1.3/lists.func.php1206 */1207MailChimpAPI_v1_3.prototype.lists = function (params, callback) {1208 if (typeof params == 'function') callback = params, params = {};1209 this.execute('lists', [1210 'filters',1211 'start',1212 'limit',1213 ], params, callback);1214}1215/*****************************************************************************/1216/************************* Security Related Methods **************************/1217/*****************************************************************************/1218/**1219 * Add an API Key to your account.1220 * 1221 * @see http://www.mailchimp.com/api/1.3/apikeyadd.func.php1222 */1223MailChimpAPI_v1_3.prototype.apikeyAdd = function (params, callback) {1224 if (typeof params == 'function') callback = params, params = {};1225 this.execute('apikeyAdd', [1226 'username',1227 'password',1228 ], params, callback);1229}1230/**1231 * Expire a Specific API Key.1232 * 1233 * @see http://www.mailchimp.com/api/1.3/apikeyexpire.func.php1234 */1235MailChimpAPI_v1_3.prototype.apikeyExpire = function (params, callback) {1236 if (typeof params == 'function') callback = params, params = {};1237 this.execute('apikeyExpire', [1238 'username',1239 'password',1240 ], params, callback);1241}1242/**1243 * Retrieve a list of all MailChimp API Keys for this User.1244 * 1245 * @see http://www.mailchimp.com/api/1.3/apikeys.func.php1246 */1247MailChimpAPI_v1_3.prototype.apikeys = function (params, callback) {1248 if (typeof params == 'function') callback = params, params = {};1249 this.execute('apikeys', [1250 'username',1251 'password',1252 'expired',1253 ], params, callback);1254}1255/*****************************************************************************/1256/************************* Template Related Methods **************************/1257/*****************************************************************************/1258/**1259 * Create a new user template, NOT campaign content.1260 * 1261 * @see http://www.mailchimp.com/api/1.3/templateadd.func.php1262 */1263MailChimpAPI_v1_3.prototype.templateAdd = function (params, callback) {1264 if (typeof params == 'function') callback = params, params = {};1265 this.execute('templateAdd', [1266 'name',1267 'html',1268 ], params, callback);1269}1270/**1271 * Delete (deactivate) a user template.1272 * 1273 * @see http://www.mailchimp.com/api/1.3/templatedel.func.php1274 */1275MailChimpAPI_v1_3.prototype.templateDel = function (params, callback) {1276 if (typeof params == 'function') callback = params, params = {};1277 this.execute('templateDel', [1278 'id',1279 ], params, callback);1280}1281/**1282 * Pull details for a specific template to help support editing.1283 * 1284 * @see http://www.mailchimp.com/api/1.3/templateinfo.func.php1285 */1286MailChimpAPI_v1_3.prototype.templateInfo = function (params, callback) {1287 if (typeof params == 'function') callback = params, params = {};1288 this.execute('templateInfo', [1289 'tid',1290 'type',1291 ], params, callback);1292}1293/**1294 * Undelete (reactivate) a user template.1295 * 1296 * @see http://www.mailchimp.com/api/1.3/templateundel.func.php1297 */1298MailChimpAPI_v1_3.prototype.templateUndel = function (params, callback) {1299 if (typeof params == 'function') callback = params, params = {};1300 this.execute('templateUndel', [1301 'id',1302 ], params, callback);1303}1304/**1305 * Replace the content of a user template, NOT campaign content.1306 * 1307 * @see http://www.mailchimp.com/api/1.3/templateupdate.func.php1308 */1309MailChimpAPI_v1_3.prototype.templateUpdate = function (params, callback) {1310 if (typeof params == 'function') callback = params, params = {};1311 this.execute('templateUpdate', [1312 'id',1313 'values',1314 ], params, callback);1315}1316/**1317 * Retrieve various templates available in the system, allowing some thing1318 * similar to our template gallery to be created.1319 * 1320 * @see http://www.mailchimp.com/api/1.3/templates.func.php1321 */1322MailChimpAPI_v1_3.prototype.templates = function (params, callback) {1323 if (typeof params == 'function') callback = params, params = {};1324 this.execute('templates', [1325 'types',1326 'inactives',1327 'category',1328 ], params, callback);...

Full Screen

Full Screen

MailChimpAPI_v1_2.js

Source:MailChimpAPI_v1_2.js Github

copy

Full Screen

...85 * @see http://www.mailchimp.com/api/1.2/campaigncontent.func.php86 */87MailChimpAPI_v1_2.prototype.campaignContent = function (params, callback) {88 if (typeof params == 'function') callback = params, params = {};89 this.execute('campaignContent', [90 'cid',91 'for_archive',92 ], params, callback);93}94/**95 * Create a new draft campaign to send.96 * 97 * @see http://www.mailchimp.com/api/1.2/campaigncreate.func.php98 */99MailChimpAPI_v1_2.prototype.campaignCreate = function (params, callback) {100 if (typeof params == 'function') callback = params, params = {};101 this.execute('campaignCreate', [102 'type',103 'options',104 'content',105 'segment_opts',106 'type_opts',107 ], params, callback);108}109/**110 * Delete a campaign.111 * 112 * @see http://www.mailchimp.com/api/1.2/campaigndelete.func.php113 */114MailChimpAPI_v1_2.prototype.campaignDelete = function (params, callback) {115 if (typeof params == 'function') callback = params, params = {};116 this.execute('campaignDelete', [117 'cid',118 ], params, callback);119}120/**121 * Attach Ecommerce Order Information to a Campaign.122 * 123 * @see http://www.mailchimp.com/api/1.2/campaignecommaddorder.func.php124 */125MailChimpAPI_v1_2.prototype.campaignEcommAddOrder = function (params, callback) {126 if (typeof params == 'function') callback = params, params = {};127 this.execute('campaignEcommAddOrder', [128 'order',129 ], params, callback);130}131/**132 * List all the folders for a user account.133 * 134 * @see http://www.mailchimp.com/api/1.2/campaignfolders.func.php135 */136MailChimpAPI_v1_2.prototype.campaignFolders = function (params, callback) {137 if (typeof params == 'function') callback = params, params = {};138 this.execute('campaignFolders', [139 ], params, callback);140}141/**142 * Pause an AutoResponder or RSS campaign from sending.143 * 144 * @see http://www.mailchimp.com/api/1.2/campaignpause.func.php145 */146MailChimpAPI_v1_2.prototype.campaignPause = function (params, callback) {147 if (typeof params == 'function') callback = params, params = {};148 this.execute('campaignPause', [149 'cid',150 ], params, callback);151}152/**153 * Replicate a campaign.154 * 155 * @see http://www.mailchimp.com/api/1.2/campaignreplicate.func.php156 */157MailChimpAPI_v1_2.prototype.campaignReplicate = function (params, callback) {158 if (typeof params == 'function') callback = params, params = {};159 this.execute('campaignReplicate', [160 'cid',161 ], params, callback);162}163/**164 * Resume sending an AutoResponder or RSS campaign.165 * 166 * @see http://www.mailchimp.com/api/1.2/campaignresume.func.php167 */168MailChimpAPI_v1_2.prototype.campaignResume = function (params, callback) {169 if (typeof params == 'function') callback = params, params = {};170 this.execute('campaignResume', [171 'cid',172 ], params, callback);173}174/**175 * Schedule a campaign to be sent in the future.176 * 177 * @see http://www.mailchimp.com/api/1.2/campaignschedule.func.php178 */179MailChimpAPI_v1_2.prototype.campaignSchedule = function (params, callback) {180 if (typeof params == 'function') callback = params, params = {};181 this.execute('campaignSchedule', [182 'cid',183 'schedule_time',184 'schedule_time_b',185 ], params, callback);186}187/**188 * Allows one to test their segmentation rules before creating a campaign using189 * them.190 * 191 * @see http://www.mailchimp.com/api/1.2/campaignsegmenttest.func.php192 */193MailChimpAPI_v1_2.prototype.campaignSegmentTest = function (params, callback) {194 if (typeof params == 'function') callback = params, params = {};195 this.execute('campaignSegmentTest', [196 'list_id',197 'options',198 ], params, callback);199}200/**201 * Send a given campaign immediately.202 * 203 * @see http://www.mailchimp.com/api/1.2/campaignsendnow.func.php204 */205MailChimpAPI_v1_2.prototype.campaignSendNow = function (params, callback) {206 if (typeof params == 'function') callback = params, params = {};207 this.execute('campaignSendNow', [208 'cid',209 ], params, callback);210}211/**212 * Send a test of this campaign to the provided email address.213 * 214 * @see http://www.mailchimp.com/api/1.2/campaignsendtest.func.php215 */216MailChimpAPI_v1_2.prototype.campaignSendTest = function (params, callback) {217 if (typeof params == 'function') callback = params, params = {};218 this.execute('campaignSendTest', [219 'cid',220 'test_emails',221 'send_type',222 ], params, callback);223}224/**225 * Get the URL to a customized VIP Report for the specified campaign and226 * optionally send an email to someone with links to it.227 * 228 * @see http://www.mailchimp.com/api/1.2/campaignsharereport.func.php229 */230MailChimpAPI_v1_2.prototype.campaignShareReport = function (params, callback) {231 if (typeof params == 'function') callback = params, params = {};232 this.execute('campaignShareReport', [233 'cid',234 'opts',235 ], params, callback);236}237/**238 * Retrieve all templates defined for your user account.239 * 240 * @see http://www.mailchimp.com/api/1.2/campaigntemplates.func.php241 */242MailChimpAPI_v1_2.prototype.campaignTemplates = function (params, callback) {243 if (typeof params == 'function') callback = params, params = {};244 this.execute('campaignTemplates', [245 ], params, callback);246}247/**248 * Unschedule a campaign that is scheduled to be sent in the future.249 * 250 * @see http://www.mailchimp.com/api/1.2/campaignunschedule.func.php251 */252MailChimpAPI_v1_2.prototype.campaignUnschedule = function (params, callback) {253 if (typeof params == 'function') callback = params, params = {};254 this.execute('campaignUnschedule', [255 'cid',256 ], params, callback);257}258/**259 * Update just about any setting for a campaign that has not been sent.260 * 261 * @see http://www.mailchimp.com/api/1.2/campaignupdate.func.php262 */263MailChimpAPI_v1_2.prototype.campaignUpdate = function (params, callback) {264 if (typeof params == 'function') callback = params, params = {};265 this.execute('campaignUpdate', [266 'cid',267 'name',268 'value',269 ], params, callback);270}271/**272 * Get the list of campaigns and their details matching the specified filters.273 * 274 * @see http://www.mailchimp.com/api/1.2/campaigns.func.php275 */276MailChimpAPI_v1_2.prototype.campaigns = function (params, callback) {277 if (typeof params == 'function') callback = params, params = {};278 this.execute('campaigns', [279 'filters',280 'start',281 'limit',282 ], params, callback);283}284/*****************************************************************************/285/************************** Campaign Stats Methods ***************************/286/*****************************************************************************/287/**288 * Get all email addresses that complained about a given campaign.289 * 290 * @see http://www.mailchimp.com/api/1.2/campaignabusereports.func.php291 */292MailChimpAPI_v1_2.prototype.campaignAbuseReports = function (params, callback) {293 if (typeof params == 'function') callback = params, params = {};294 this.execute('campaignAbuseReports', [295 'cid',296 'since',297 'start',298 'limit',299 ], params, callback);300}301/**302 * Retrieve the text presented in the MailChimp app for how a campaign303 * performed and any advice MailChimp may have for you - best suited for 304 * display in customized reports pages.305 * 306 * @see http://www.mailchimp.com/api/1.2/campaignadvice.func.php307 */308MailChimpAPI_v1_2.prototype.campaignAdvice = function (params, callback) {309 if (typeof params == 'function') callback = params, params = {};310 this.execute('campaignAdvice', [311 'cid',312 ], params, callback);313}314/**315 * Retrieve the Google Analytics data MailChimp has collected for this 316 * campaign.317 * 318 * @see http://www.mailchimp.com/api/1.2/campaignanalytics.func.php319 */320MailChimpAPI_v1_2.prototype.campaignAnalytics = function (params, callback) {321 if (typeof params == 'function') callback = params, params = {};322 this.execute('campaignAnalytics', [323 'cid',324 ], params, callback);325}326/**327 * Retrieve the full bounce messages for the given campaign.328 * 329 * @see http://www.mailchimp.com/api/1.2/campaignbouncemessages.func.php330 */331MailChimpAPI_v1_2.prototype.campaignBounceMessages = function (params, callback) {332 if (typeof params == 'function') callback = params, params = {};333 this.execute('campaignBounceMessages', [334 'cid',335 'start',336 'limit',337 'since',338 ], params, callback);339}340/**341 * Get an array of the urls being tracked, and their click counts for a given 342 * campaign.343 * 344 * @see http://www.mailchimp.com/api/1.2/campaignclickstats.func.php345 */346MailChimpAPI_v1_2.prototype.campaignClickStats = function (params, callback) {347 if (typeof params == 'function') callback = params, params = {};348 this.execute('campaignClickStats', [349 'cid',350 ], params, callback);351}352/**353 * Retrieve the Ecommerce Orders tracked by campaignEcommAddOrder().354 * 355 * @see http://www.mailchimp.com/api/1.2/campaignecommorders.func.php356 */357MailChimpAPI_v1_2.prototype.campaignEcommOrders = function (params, callback) {358 if (typeof params == 'function') callback = params, params = {};359 this.execute('campaignEcommOrders', [360 'cid',361 'start',362 'limit',363 'since',364 ], params, callback);365}366/**367 * Retrieve the tracked eepurl mentions on Twitter.368 * 369 * @see http://www.mailchimp.com/api/1.2/campaigneepurlstats.func.php370 */371MailChimpAPI_v1_2.prototype.campaignEepUrlStats = function (params, callback) {372 if (typeof params == 'function') callback = params, params = {};373 this.execute('campaignEepUrlStats', [374 'cid',375 ], params, callback);376}377/**378 * Get the top 5 performing email domains for this campaign.379 * 380 * @see http://www.mailchimp.com/api/1.2/campaignemaildomainperformance.func.php381 */382MailChimpAPI_v1_2.prototype.campaignEmailDomainPerformance = function (params, callback) {383 if (typeof params == 'function') callback = params, params = {};384 this.execute('campaignEmailDomainPerformance', [385 'cid',386 ], params, callback);387}388/**389 * Retrieve the countries and number of opens tracked for each.390 * 391 * @see http://www.mailchimp.com/api/1.2/campaigngeoopens.func.php392 */393MailChimpAPI_v1_2.prototype.campaignGeoOpens = function (params, callback) {394 if (typeof params == 'function') callback = params, params = {};395 this.execute('campaignGeoOpens', [396 'cid',397 ], params, callback);398}399/**400 * Retrieve the regions and number of opens tracked for a certain country.401 * 402 * @see http://www.mailchimp.com/api/1.2/campaigngeoopensforcountry.func.php403 */404MailChimpAPI_v1_2.prototype.campaignGeoOpensForCountry = function (params, callback) {405 if (typeof params == 'function') callback = params, params = {};406 this.execute('campaignGeoOpensForCountry', [407 'cid',408 'code',409 ], params, callback);410}411/**412 * Get all email addresses with Hard Bounces for a given campaign.413 * 414 * @see http://www.mailchimp.com/api/1.2/campaignhardbounces.func.php415 */416MailChimpAPI_v1_2.prototype.campaignHardBounces = function (params, callback) {417 if (typeof params == 'function') callback = params, params = {};418 this.execute('campaignHardBounces', [419 'cid',420 'start',421 'limit',422 ], params, callback);423}424/**425 * Get all email addresses with Soft Bounces for a given campaign.426 * 427 * @see http://www.mailchimp.com/api/1.2/campaignsoftbounces.func.php428 */429MailChimpAPI_v1_2.prototype.campaignSoftBounces = function (params, callback) {430 if (typeof params == 'function') callback = params, params = {};431 this.execute('campaignSoftBounces', [432 'cid',433 'start',434 'limit',435 ], params, callback);436}437/**438 * Given a list and a campaign, get all the relevant campaign statistics439 * (opens, bounces, clicks, etc.).440 * 441 * @see http://www.mailchimp.com/api/1.2/campaignstats.func.php442 */443MailChimpAPI_v1_2.prototype.campaignStats = function (params, callback) {444 if (typeof params == 'function') callback = params, params = {};445 this.execute('campaignStats', [446 'cid',447 ], params, callback);448}449/**450 * Get all unsubscribed email addresses for a given campaign.451 * 452 * @see http://www.mailchimp.com/api/1.2/campaignunsubscribes.func.php453 */454MailChimpAPI_v1_2.prototype.campaignUnsubscribes = function (params, callback) {455 if (typeof params == 'function') callback = params, params = {};456 this.execute('campaignUnsubscribes', [457 'cid',458 'start',459 'limit',460 ], params, callback);461}462/*****************************************************************************/463/*************************** Campaign AIM Methods ***************************/464/*****************************************************************************/465/**466 * Return the list of email addresses that clicked on a given url, and how many467 * times they clicked.468 * 469 * @see http://www.mailchimp.com/api/1.2/campaignclickdetailaim.func.php470 */471MailChimpAPI_v1_2.prototype.campaignClickDetailAIM = function (params, callback) {472 if (typeof params == 'function') callback = params, params = {};473 this.execute('campaignClickDetailAIM', [474 'cid',475 'url',476 'start',477 'limit',478 ], params, callback);479}480/**481 * Given a campaign and email address, return the entire click and open history482 * with timestamps, ordered by time.483 * 484 * @see http://www.mailchimp.com/api/1.2/campaignemailstatsaim.func.php485 */486MailChimpAPI_v1_2.prototype.campaignEmailStatsAIM = function (params, callback) {487 if (typeof params == 'function') callback = params, params = {};488 this.execute('campaignEmailStatsAIM', [489 'cid',490 'email_address',491 ], params, callback);492}493/**494 * Given a campaign and correct paging limits, return the entire click and open495 * history with timestamps, ordered by time, for every user a campaign was 496 * delivered to.497 * 498 * @see http://www.mailchimp.com/api/1.2/campaignemailstatsaimall.func.php499 */500MailChimpAPI_v1_2.prototype.campaignEmailStatsAIMAll = function (params, callback) {501 if (typeof params == 'function') callback = params, params = {};502 this.execute('campaignEmailStatsAIMAll', [503 'cid',504 'start',505 'limit',506 ], params, callback);507}508/**509 * Retrieve the list of email addresses that did not open a given campaign.510 * 511 * @see http://www.mailchimp.com/api/1.2/campaignnotopenedaim.func.php512 */513MailChimpAPI_v1_2.prototype.campaignNotOpenedAIM = function (params, callback) {514 if (typeof params == 'function') callback = params, params = {};515 this.execute('campaignNotOpenedAIM', [516 'cid',517 'start',518 'limit',519 ], params, callback);520}521/**522 * Retrieve the list of email addresses that opened a given campaign with how523 * many times they opened - note: this AIM function is free and does not 524 * actually require the AIM module to be installed.525 * 526 * @see http://www.mailchimp.com/api/1.2/campaignopenedaim.func.php527 */528MailChimpAPI_v1_2.prototype.campaignOpenedAIM = function (params, callback) {529 if (typeof params == 'function') callback = params, params = {};530 this.execute('campaignOpenedAIM', [531 'cid',532 'start',533 'limit',534 ], params, callback);535}536/*****************************************************************************/537/****************************** Helper Methods *******************************/538/*****************************************************************************/539/**540 * Return the current Chimp Chatter messages for an account.541 * 542 * @see http://www.mailchimp.com/api/1.2/chimpchatter.func.php543 */544MailChimpAPI_v1_2.prototype.chimpChatter = function (params, callback) {545 if (typeof params == 'function') callback = params, params = {};546 this.execute('chimpChatter', [547 ], params, callback);548}549/**550 * Create a new folder to file campaigns in.551 * 552 * @see http://www.mailchimp.com/api/1.2/createfolder.func.php553 */554MailChimpAPI_v1_2.prototype.createFolder = function (params, callback) {555 if (typeof params == 'function') callback = params, params = {};556 this.execute('createFolder', [557 'name',558 ], params, callback);559}560/**561 * Import Ecommerce Order Information to be used for Segmentation.562 * 563 * @see http://www.mailchimp.com/api/1.2/ecommaddorder.func.php564 */565MailChimpAPI_v1_2.prototype.ecommAddOrder = function (params, callback) {566 if (typeof params == 'function') callback = params, params = {};567 this.execute('createFolder', [568 'order',569 ], params, callback);570}571/**572 * Have HTML content auto-converted to a text-only format.573 * 574 * @see http://www.mailchimp.com/api/1.2/generatetext.func.php575 */576MailChimpAPI_v1_2.prototype.generateText = function (params, callback) {577 if (typeof params == 'function') callback = params, params = {};578 this.execute('generateText', [579 'type',580 'content',581 ], params, callback);582}583/**584 * Retrieve lots of account information including payments made, plan info, 585 * some account stats, installed modules, contact info, and more.586 * 587 * @see http://www.mailchimp.com/api/1.2/getaccountdetails.func.php588 */589MailChimpAPI_v1_2.prototype.getAccountDetails = function (params, callback) {590 if (typeof params == 'function') callback = params, params = {};591 this.execute('getAccountDetails', [592 ], params, callback);593}594/**595 * @deprecated Retrieve your User Unique Id and your Affiliate link to display/596 * use for Monkey Rewards.597 * 598 * @see http://www.mailchimp.com/api/1.2/getaffiliateinfo.func.php599 */600MailChimpAPI_v1_2.prototype.getAffiliateInfo = function (params, callback) {601 if (typeof params == 'function') callback = params, params = {};602 this.execute('getAffiliateInfo', [603 ], params, callback);604}605/**606 * Send your HTML content to have the CSS inlined and optionally remove the607 * original styles.608 * 609 * @see http://www.mailchimp.com/api/1.2/inlinecss.func.php610 */611MailChimpAPI_v1_2.prototype.inlineCss = function (params, callback) {612 if (typeof params == 'function') callback = params, params = {};613 this.execute('inlineCss', [614 'html',615 'strip_css',616 ], params, callback);617}618/**619 * Retrieve all List Ids a member is subscribed to.620 * 621 * @see http://www.mailchimp.com/api/1.2/listsforemail.func.php622 */623MailChimpAPI_v1_2.prototype.listsForEmail = function (params, callback) {624 if (typeof params == 'function') callback = params, params = {};625 this.execute('listsForEmail', [626 'email_address',627 ], params, callback);628}629/**630 * "Ping" the MailChimp API - a simple method you can call that will return a631 * constant value as long as everything is good.632 * 633 * @see http://www.mailchimp.com/api/1.2/ping.func.php634 */635MailChimpAPI_v1_2.prototype.ping = function (params, callback) {636 if (typeof params == 'function') callback = params, params = {};637 this.execute('ping', [638 ], params, callback);639}640/*****************************************************************************/641/*************************** List Related Methods ****************************/642/*****************************************************************************/643/**644 * Get all email addresses that complained about a given campaign.645 * 646 * @see http://www.mailchimp.com/api/1.2/listabusereports.func.php647 */648MailChimpAPI_v1_2.prototype.listAbuseReports = function (params, callback) {649 if (typeof params == 'function') callback = params, params = {};650 this.execute('listAbuseReports', [651 'id',652 'start',653 'limit',654 'since',655 ], params, callback);656}657/**658 * Save a segment against a list for later use.659 * 660 * @see http://www.mailchimp.com/api/1.2/listaddstaticsegment.func.php661 */662MailChimpAPI_v1_2.prototype.listAddStaticSegment = function (params, callback) {663 if (typeof params == 'function') callback = params, params = {};664 this.execute('listAddStaticSegment', [665 'id',666 'name',667 ], params, callback);668}669/**670 * Subscribe a batch of email addresses to a list at once.671 * 672 * @see http://www.mailchimp.com/api/1.2/listbatchsubscribe.func.php673 */674MailChimpAPI_v1_2.prototype.listBatchSubscribe = function (params, callback) {675 if (typeof params == 'function') callback = params, params = {};676 this.execute('listBatchSubscribe', [677 'id',678 'batch',679 'double_optin',680 'update_existing',681 'replace_interests',682 ], params, callback);683}684/**685 * Unsubscribe a batch of email addresses to a list.686 * 687 * @see http://www.mailchimp.com/api/1.2/listbatchunsubscribe.func.php688 */689MailChimpAPI_v1_2.prototype.listBatchUnsubscribe = function (params, callback) {690 if (typeof params == 'function') callback = params, params = {};691 this.execute('listBatchUnsubscribe', [692 'id',693 'emails',694 'delete_member',695 'send_goodbye',696 'send_notify',697 ], params, callback);698}699/**700 * Delete a static segment.701 * 702 * @see http://www.mailchimp.com/api/1.2/listdelstaticsegment.func.php703 */704MailChimpAPI_v1_2.prototype.listDelStaticSegment = function (params, callback) {705 if (typeof params == 'function') callback = params, params = {};706 this.execute('listDelStaticSegment', [707 'id',708 'seg_id',709 ], params, callback);710}711/**712 * Access the Growth History by Month for a given list.713 * 714 * @see http://www.mailchimp.com/api/1.2/listgrowthhistory.func.php715 */716MailChimpAPI_v1_2.prototype.listGrowthHistory = function (params, callback) {717 if (typeof params == 'function') callback = params, params = {};718 this.execute('listGrowthHistory', [719 'id',720 ], params, callback);721}722/**723 * Add a single Interest Group - if interest groups for the List are not yet724 * enabled, adding the first group will automatically turn them on.725 * 726 * @see http://www.mailchimp.com/api/1.2/listinterestgroupadd.func.php727 */728MailChimpAPI_v1_2.prototype.listInterestGroupAdd = function (params, callback) {729 if (typeof params == 'function') callback = params, params = {};730 this.execute('listInterestGroupAdd', [731 'id',732 'group_name',733 'grouping_id',734 ], params, callback);735}736/**737 * Delete a single Interest Group - if the last group for a list is deleted, 738 * this will also turn groups for the list off.739 * 740 * @see http://www.mailchimp.com/api/1.2/listinterestgroupdel.func.php741 */742MailChimpAPI_v1_2.prototype.listInterestGroupDel = function (params, callback) {743 if (typeof params == 'function') callback = params, params = {};744 this.execute('listInterestGroupDel', [745 'id',746 'group_name',747 'grouping_id',748 'optional',749 ], params, callback);750}751/**752 * Change the name of an Interest Group.753 * 754 * @see http://www.mailchimp.com/api/1.2/listinterestgroupupdate.func.php755 */756MailChimpAPI_v1_2.prototype.listInterestGroupUpdate = function (params, callback) {757 if (typeof params == 'function') callback = params, params = {};758 this.execute('listInterestGroupUpdate', [759 'id',760 'old_name',761 'new_name',762 'grouping_id',763 'optional',764 ], params, callback);765}766/**767 * Add a new Interest Grouping - if interest groups for the List are not yet768 * enabled, adding the first grouping will automatically turn them on.769 * 770 * @see http://www.mailchimp.com/api/1.2/listinterestgroupingadd.func.php771 */772MailChimpAPI_v1_2.prototype.listInterestGroupingAdd = function (params, callback) {773 if (typeof params == 'function') callback = params, params = {};774 this.execute('listInterestGroupingAdd', [775 'id',776 'name',777 'type',778 'groups',779 ], params, callback);780}781/**782 * Delete an existing Interest Grouping - this will permanently delete all783 * contained interest groups and will remove those selections from all list 784 * members.785 * 786 * @see http://www.mailchimp.com/api/1.2/listinterestgroupingdel.func.php787 */788MailChimpAPI_v1_2.prototype.listInterestGroupingDel = function (params, callback) {789 if (typeof params == 'function') callback = params, params = {};790 this.execute('listInterestGroupingDel', [791 'grouping_id',792 ], params, callback);793}794/**795 * Update an existing Interest Grouping.796 * 797 * @see http://www.mailchimp.com/api/1.2/listinterestgroupingupdate.func.php798 */799MailChimpAPI_v1_2.prototype.listInterestGroupingUpdate = function (params, callback) {800 if (typeof params == 'function') callback = params, params = {};801 this.execute('listInterestGroupingUpdate', [802 'grouping_id',803 'name',804 'value',805 ], params, callback);806}807/**808 * Get the list of interest groupings for a given list, including the label,809 * form information, and included groups for each.810 * 811 * @see http://www.mailchimp.com/api/1.2/listinterestgroupings.func.php812 */813MailChimpAPI_v1_2.prototype.listInterestGroupings = function (params, callback) {814 if (typeof params == 'function') callback = params, params = {};815 this.execute('listInterestGroupings', [816 'id',817 ], params, callback);818}819/**820 * @deprecated Get the list of interest groups for a given list, including the821 * label and form information822 * 823 * @see http://www.mailchimp.com/api/1.2/listinterestgroups.func.php824 */825MailChimpAPI_v1_2.prototype.listInterestGroups = function (params, callback) {826 if (typeof params == 'function') callback = params, params = {};827 this.execute('listInterestGroups', [828 'id',829 ], params, callback);830}831/**832 * Get all the information for particular members of a list.833 * 834 * @see http://www.mailchimp.com/api/1.2/listmemberinfo.func.php835 */836MailChimpAPI_v1_2.prototype.listMemberInfo = function (params, callback) {837 if (typeof params == 'function') callback = params, params = {};838 this.execute('listMemberInfo', [839 'id',840 'email_address',841 ], params, callback);842}843/**844 * Get all of the list members for a list that are of a particular status.845 * 846 * @see http://www.mailchimp.com/api/1.2/listmembers.func.php847 */848MailChimpAPI_v1_2.prototype.listMembers = function (params, callback) {849 if (typeof params == 'function') callback = params, params = {};850 this.execute('listMembers', [851 'id',852 'status',853 'since',854 'start',855 'limit',856 ], params, callback);857}858/**859 * Add a new merge tag to a given list.860 * 861 * @see http://www.mailchimp.com/api/1.2/listmergevaradd.func.php862 */863MailChimpAPI_v1_2.prototype.listMergeVarAdd = function (params, callback) {864 if (typeof params == 'function') callback = params, params = {};865 this.execute('listMergeVarAdd', [866 'id',867 'tag',868 'name',869 'req',870 ], params, callback);871}872/**873 * Delete a merge tag from a given list and all its members.874 * 875 * @see http://www.mailchimp.com/api/1.2/listmergevardel.func.php876 */877MailChimpAPI_v1_2.prototype.listMergeVarDel = function (params, callback) {878 if (typeof params == 'function') callback = params, params = {};879 this.execute('listMergeVarDel', [880 'id',881 'tag',882 ], params, callback);883}884/**885 * Update most parameters for a merge tag on a given list.886 * 887 * @see http://www.mailchimp.com/api/1.2/listmergevarupdate.func.php888 */889MailChimpAPI_v1_2.prototype.listMergeVarUpdate = function (params, callback) {890 if (typeof params == 'function') callback = params, params = {};891 this.execute('listMergeVarUpdate', [892 'id',893 'tag',894 'options',895 ], params, callback);896}897/**898 * Get the list of merge tags for a given list, including their name, tag, and899 * required setting.900 * 901 * @see http://www.mailchimp.com/api/1.2/listmergevars.func.php902 */903MailChimpAPI_v1_2.prototype.listMergeVars = function (params, callback) {904 if (typeof params == 'function') callback = params, params = {};905 this.execute('listMergeVars', [906 'id',907 ], params, callback);908}909/**910 * Resets a static segment - removes all members from the static segment.911 * 912 * @see http://www.mailchimp.com/api/1.2/listresetstaticsegment.func.php913 */914MailChimpAPI_v1_2.prototype.listResetStaticSegment = function (params, callback) {915 if (typeof params == 'function') callback = params, params = {};916 this.execute('listResetStaticSegment', [917 'id',918 'seg_id',919 ], params, callback);920}921/**922 * Add list members to a static segment.923 * 924 * @see http://www.mailchimp.com/api/1.2/liststaticsegmentaddmembers.func.php925 */926MailChimpAPI_v1_2.prototype.listStaticSegmentAddMembers = function (params, callback) {927 if (typeof params == 'function') callback = params, params = {};928 this.execute('listStaticSegmentAddMembers', [929 'id',930 'seg_id',931 'batch',932 ], params, callback);933}934/**935 * Remove list members from a static segment.936 * 937 * @see http://www.mailchimp.com/api/1.2/liststaticsegmentdelmembers.func.php938 */939MailChimpAPI_v1_2.prototype.listStaticSegmentDelMembers = function (params, callback) {940 if (typeof params == 'function') callback = params, params = {};941 this.execute('listStaticSegmentDelMembers', [942 'id',943 'seg_id',944 'batch',945 ], params, callback);946}947/**948 * Retrieve all of the Static Segments for a list.949 * 950 * @see http://www.mailchimp.com/api/1.2/liststaticsegments.func.php951 */952MailChimpAPI_v1_2.prototype.listStaticSegments = function (params, callback) {953 if (typeof params == 'function') callback = params, params = {};954 this.execute('listStaticSegments', [955 'id',956 ], params, callback);957}958/**959 * Subscribe the provided email to a list.960 * 961 * @see http://www.mailchimp.com/api/1.2/listsubscribe.func.php962 */963MailChimpAPI_v1_2.prototype.listSubscribe = function (params, callback) {964 if (typeof params == 'function') callback = params, params = {};965 this.execute('listSubscribe', [966 'id',967 'email_address',968 'merge_vars',969 'email_type',970 'double_optin',971 'update_existing',972 'replace_interests',973 'send_welcome',974 ], params, callback);975}976/**977 * Unsubscribe the given email address from the list.978 * 979 * @see http://www.mailchimp.com/api/1.2/listunsubscribe.func.php980 */981MailChimpAPI_v1_2.prototype.listUnsubscribe = function (params, callback) {982 if (typeof params == 'function') callback = params, params = {};983 this.execute('listUnsubscribe', [984 'id',985 'email_address',986 'delete_member',987 'send_goodbye',988 'send_notify',989 ], params, callback);990}991/**992 * Edit the email address, merge fields, and interest groups for a list member.993 * 994 * @see http://www.mailchimp.com/api/1.2/listupdatemember.func.php995 */996MailChimpAPI_v1_2.prototype.listUpdateMember = function (params, callback) {997 if (typeof params == 'function') callback = params, params = {};998 this.execute('listUpdateMember', [999 'id',1000 'email_address',1001 'merge_vars',1002 'email_type',1003 'replace_interests',1004 ], params, callback);1005}1006/**1007 * Add a new Webhook URL for the given list.1008 * 1009 * @see http://www.mailchimp.com/api/1.2/listwebhookadd.func.php1010 */1011MailChimpAPI_v1_2.prototype.listWebhookAdd = function (params, callback) {1012 if (typeof params == 'function') callback = params, params = {};1013 this.execute('listWebhookAdd', [1014 'id',1015 'url',1016 'actions',1017 'sources',1018 ], params, callback);1019}1020/**1021 * Delete an existing Webhook URL from a given list.1022 * 1023 * @see http://www.mailchimp.com/api/1.2/listwebhookdel.func.php1024 */1025MailChimpAPI_v1_2.prototype.listWebhookDel = function (params, callback) {1026 if (typeof params == 'function') callback = params, params = {};1027 this.execute('listWebhookDel', [1028 'id',1029 'url',1030 ], params, callback);1031}1032/**1033 * Return the Webhooks configured for the given list.1034 * 1035 * @see http://www.mailchimp.com/api/1.2/listwebhooks.func.php1036 */1037MailChimpAPI_v1_2.prototype.listWebhooks = function (params, callback) {1038 if (typeof params == 'function') callback = params, params = {};1039 this.execute('listWebhooks', [1040 'id',1041 ], params, callback);1042}1043/**1044 * Retrieve all of the lists defined for your user account.1045 * 1046 * @see http://www.mailchimp.com/api/1.2/lists.func.php1047 */1048MailChimpAPI_v1_2.prototype.lists = function (params, callback) {1049 if (typeof params == 'function') callback = params, params = {};1050 this.execute('lists', [1051 ], params, callback);1052}1053/*****************************************************************************/1054/************************* Security Related Methods **************************/1055/*****************************************************************************/1056/**1057 * Add an API Key to your account.1058 * 1059 * @see http://www.mailchimp.com/api/1.2/apikeyadd.func.php1060 */1061MailChimpAPI_v1_2.prototype.apikeyAdd = function (params, callback) {1062 if (typeof params == 'function') callback = params, params = {};1063 this.execute('apikeyAdd', [1064 'username',1065 'password',1066 ], params, callback);1067}1068/**1069 * Expire a Specific API Key.1070 * 1071 * @see http://www.mailchimp.com/api/1.2/apikeyexpire.func.php1072 */1073MailChimpAPI_v1_2.prototype.apikeyExpire = function (params, callback) {1074 if (typeof params == 'function') callback = params, params = {};1075 this.execute('apikeyExpire', [1076 'username',1077 'password',1078 ], params, callback);1079}1080/**1081 * Retrieve a list of all MailChimp API Keys for this User.1082 * 1083 * @see http://www.mailchimp.com/api/1.2/apikeys.func.php1084 */1085MailChimpAPI_v1_2.prototype.apikeys = function (params, callback) {1086 if (typeof params == 'function') callback = params, params = {};1087 this.execute('apikeys', [1088 'username',1089 'password',1090 'expired',1091 ], params, callback);...

Full Screen

Full Screen

Kooboo.Market.js

Source:Kooboo.Market.js Github

copy

Full Screen

1(function() {2 function extend(Child, Parent) {3 Child.prototype = Parent.__proto__;4 }5 function Discussion() {6 this.name = "Discussion";7 this.get = function(para) {8 return this.executeGet("Get", para);9 };10 this.getCommentList = function(para) {11 return this.executeGet("CommentList", para);12 };13 this.getNestCommentList = function(para) {14 return this.executeGet("NestCommentList", para);15 };16 this.addOrUpdate = function(para) {17 return this.executePost("AddOrUpdate", para);18 };19 this.reply = function(para) {20 return this.executePost("Reply", para);21 };22 this.ListByUser = function(para) {23 return this.executeGet("ListByUser", para);24 };25 }26 extend(Discussion, Kooboo.BaseModel);27 function Demand() {28 this.name = "Demand";29 this.ListByUser = function(para) {30 return this.executeGet("ListByUser", para);31 };32 this.addOrUpdate = function(para) {33 return this.executePost("AddOrUpdate", para);34 };35 this.proposalListByDemand = function(para) {36 return this.executeGet("ProposalListByDemand", para);37 };38 this.getUserProposal = function(para) {39 return this.executeGet("GetUserProposal", para);40 };41 this.getProposal = function(para) {42 return this.executeGet("GetProposal", para);43 };44 this.acceptProposal = function(para) {45 return this.executeGet("AcceptProposal", para);46 };47 this.deleteProposal = function(para) {48 return this.executePost("DeleteProposal", para);49 };50 this.addOrUpdateProposal = function(para) {51 return this.executePost("AddOrUpdateProposal", para);52 };53 this.reply = function(para) {54 return this.executePost("ReplyDemand", para, true);55 };56 this.chat = function(para) {57 return this.executePost("ReplyChat", para, true);58 };59 this.complete = function(para) {60 return this.executePost("complete", para);61 };62 this.getPublicCommentList = function(para) {63 return this.executeGet("PublicCommentList", para);64 };65 this.getNestedPublicCommentList = function(para) {66 return this.executeGet("NestedPublicCommentList", para);67 };68 this.getPublicNestedCommentList = function(para) {69 return this.executeGet("PublicNestedCommentList", para);70 };71 this.getPrivateCommentList = function(para) {72 return this.executeGet("PrivateCommentList", para, true);73 };74 this.proposalTypes = function(para) {75 return this.executeGet("ProposalTypes", para);76 };77 this.MyProposals = function(para) {78 return this.executeGet("MyProposals", para);79 };80 this.raiseObjection = function(para) {81 return this.executePost("RaiseAnObjection", para);82 };83 this.getDemandObjection = function(para) {84 return this.executeGet("GetDemandObjection", para);85 };86 this.getDemandObejctionList = function(para) {87 return this.executeGet("GetDemandObjectionList", para);88 };89 }90 extend(Demand, Kooboo.BaseModel);91 function Supplier() {92 this.name = "Supplier";93 this.list = function(para) {94 return this.executeGet("List", para);95 };96 this.myList = function(para) {97 return this.executeGet("myList", para);98 };99 this.delete = function(para) {100 return this.executePost("Delete", para);101 };102 this.deletes = function(para) {103 return this.executePost("deletes", para);104 };105 this.addOrUpdate = function(para) {106 return this.executePost("addOrUpdate", para);107 };108 this.myOrdersIn = function() {109 return this.executePost("MyOrders", { in: true });110 };111 this.myOrdersOut = function() {112 return this.executePost("MyOrders", { in: false });113 };114 this.getOrder = function(para) {115 return this.executeGet("GetOrder", para);116 };117 this.get = function(para) {118 return this.executeGet("get", para);119 };120 this.isSupplier = function(para) {121 return this.executeGet("IsSupplier", para);122 };123 this.getByUser = function(para) {124 return this.executeGet("GetByUser", para);125 };126 this.getOrdersBySupplier = function(para) {127 // 我收到的所有 orders128 return this.executeGet("MySupplyOrders", para);129 };130 this.addOrUpdateOrder = function(para) {131 return this.executePost("AddOrUpdateOrder", para);132 };133 this.acceptOrder = function(para) {134 return this.executePost("AcceptSupplierOrder", para);135 };136 this.orderFinished = function(para) {137 return this.executePost("ConfirmSupplierOrder", para);138 };139 this.getMyOrdersInSupply = function(para) {140 // 在 supply 中发出的 orders141 return this.executeGet("MyOrdersFilterBySupplier", para);142 };143 this.reply = function(para) {144 return this.executePost("Reply", para);145 };146 this.getPublicCommentList = function(para) {147 return this.executeGet("PublicCommentList", para, true);148 };149 this.onComplete = function(para) {150 return this.executePost("Complete", para);151 };152 }153 extend(Supplier, Kooboo.BaseModel);154 function Infrastructure() {155 this.name = "Infrastructure";156 this.getSalesItems = function(para) {157 return this.executeGet("SalesItems", para);158 };159 this.order = function(para) {160 return this.executePost("Order", para);161 };162 this.getMonthlyReport = function(para) {163 return this.executeGet("MonthlyReport", para);164 };165 this.getMonthlyLogs = function(para) {166 return this.executeGet("MonthlyLogs", para, true);167 };168 this.getTypes = function(para) {169 return this.executeGet("Types", para);170 };171 this.getMyOrders = function(para) {172 return this.executeGet("MyOrders", para);173 };174 this.getSalesItem = function(para) {175 return this.executeGet("GetSalesItem", para);176 };177 }178 extend(Infrastructure, Kooboo.BaseModel);179 function Balance() {180 this.name = "Balance";181 this.getBalance = function(para) {182 return this.executeGet("GetBalance", para);183 };184 this.getChargePackages = function(para) {185 return this.executeGet("ChargePackages", para);186 };187 this.topup = function(para) {188 return this.executePost("Topup", para);189 };190 this.getTopupHistory = function(para) {191 return this.executeGet("TopupHistory", para);192 };193 this.getPaymentStatus = function(para) {194 return this.executeGet("PaymentStatus", para, true);195 };196 }197 extend(Balance, Kooboo.BaseModel);198 function App() {199 this.name = "App";200 this.getPersonal = function(para) {201 return this.executeGet("Personal", para);202 };203 this.getPrivate = function(para) {204 return this.executeGet("Private", para);205 };206 }207 extend(App, Kooboo.BaseModel);208 function Payment() {209 this.name = "ServerPayment";210 this.getMethods = function(para) {211 return this.executeGet("Methods", para);212 };213 this.getStatus = function(para) {214 return this.executeGet("Status", para, true);215 };216 }217 extend(Payment, Kooboo.BaseModel);218 function Order() {219 this.name = "ServerOrder";220 this.topup = function(para) {221 return this.executePost("Topup", para);222 };223 this.domain = function(para) {224 return this.executePost("Domain", para);225 };226 this.infra = function(para) {227 return this.executePost("Infra", para);228 };229 this.useCoupon = function(para) {230 return this.executePost("UseCoupon", para);231 };232 this.pay = function(para) {233 return this.executePost("Pay", para);234 };235 this.service = function(para) {236 return this.executePost("Service", para);237 };238 }239 extend(Order, Kooboo.BaseModel);240 function Market() {241 this.name = "Market";242 this.getMy = function(para) {243 return this.executeGet("My", para);244 };245 }246 extend(Market, Kooboo.BaseModel);247 function Attachment() {248 this.name = "Attachment";249 this.uploadFile = function(para) {250 return this.executeUpload("UploadFile", para);251 };252 this.deleteFile = function(para) {253 return this.executePost("DeleteFile", para);254 };255 }256 extend(Attachment, Kooboo.BaseModel);257 Kooboo = Object.assign(258 {259 App: new App(),260 Attachment: new Attachment(),261 Balance: new Balance(),262 Infrastructure: new Infrastructure(),263 Demand: new Demand(),264 Discussion: new Discussion(),265 Market: new Market(),266 Order: new Order(),267 Payment: new Payment(),268 Supplier: new Supplier()269 },270 Kooboo271 );...

Full Screen

Full Screen

mathml_store_test.js

Source:mathml_store_test.js Github

copy

Full Screen

1// Copyright 2013 Google Inc.2//3// Licensed under the Apache License, Version 2.0 (the "License");4// you may not use this file except in compliance with the License.5// You may obtain a copy of the License at6//7// http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// distributed under the License is distributed on an "AS IS" BASIS,11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12// See the License for the specific language governing permissions and13// limitations under the License.14/**15 * @fileoverview Testcases for math node functions.16 * @author sorge@google.com (Volker Sorge)17 */18goog.provide('cvox.MathmlStoreTest');19goog.require('cvox.AbstractTestCase');20goog.require('cvox.ChromeVoxTester');21goog.require('cvox.MathStore');22goog.require('cvox.MathmlStore');23/**24 * @constructor25 * @extends {cvox.AbstractTestCase}26 */27cvox.MathmlStoreTest = function() {28 goog.base(this);29};30goog.inherits(cvox.MathmlStoreTest, cvox.AbstractTestCase);31/**32 * @override33 */34cvox.MathmlStoreTest.prototype.setUpTest = function() {35 this.rules = cvox.MathmlStore.getInstance();36 cvox.SpeechRuleEngine.getInstance().parameterize(this.rules);37 this.nodeCounter = 0;38};39/**40 * Tests if for a given html snippet the applicable rule is indeed the same41 * as the one provided.42 * @param {string} html Snippet of a MathML expression.43 * @param {string} ruleName Key of the rule that is expected to be applied.44 */45cvox.MathmlStoreTest.prototype.executeRuleTest = function(html, ruleName) {46 var mathMl = '<math id=' + this.nodeCounter + '>' + html + '</math>';47 this.appendHtml(mathMl);48 var node = document.getElementById((this.nodeCounter++).toString());49 var rule = this.rules.lookupRule(node.childNodes[0],50 {domain: 'default', style: 'default'});51 this.assertEquals(ruleName, rule.name);52};53/**54 * Test MathML rules for space elements.55 * @export56 */57cvox.MathmlStoreTest.prototype.testMathmlEmptyRules = function() {58 this.executeRuleTest('<mspace depth="40px"/>', 'mspace');59 this.executeRuleTest(60 '<mstyle displaystyle="true"><mn>1</mn><mstyle>', 'mstyle');61 this.executeRuleTest(62 '<mpadded height="+150px"><mn>1</mn></mpadded>', 'mpadded');63 this.executeRuleTest('<merror><mn>1</mn></merror>', 'merror');64 this.executeRuleTest('<mphantom><mn>1</mn></mphantom>', 'mphantom');65};66/**67 * Test MathML rules for simple token elements.68 * @export69 */70cvox.MathmlStoreTest.prototype.testMathmlTokenRules = function() {71 this.executeRuleTest('<mi>x</mi>', 'mi');72 this.executeRuleTest('<mn>1</mn>', 'mn');73 this.executeRuleTest('<mo>+</mo>', 'mo');74 this.executeRuleTest('<mtext>therefore we have</mtext>', 'mtext');75 this.executeRuleTest('<ms>therefore we have</ms>', 'ms');76};77/**78 * Test MathML rules for token elements involving font declarations.79 * @export80 */81cvox.MathmlStoreTest.prototype.testMathmlFontRules = function() {82 this.executeRuleTest('<mi mathvariant="normal">N</mi>', 'mi');83 this.executeRuleTest('<mi mathvariant="double-struck">N</mi>', 'mi-variant');84 this.executeRuleTest('<mn mathvariant="normal">1</mn>', 'mn');85 this.executeRuleTest('<mn mathvariant="fraktur">1</mn>', 'mi-variant');86 this.executeRuleTest('<mo mathvariant="normal">+</mo>', 'mo');87 this.executeRuleTest('<mo mathvariant="monospace">+</mo>', 'mo-variant');88 this.executeRuleTest(89 '<mtext mathvariant="normal">therefore we have</mtext>', 'mtext');90 this.executeRuleTest(91 '<mtext mathvariant="bold">therefore we have</mtext>', 'mtext-variant');92};93/**94 * Test MathML rules for script elements.95 * @export96 */97cvox.MathmlStoreTest.prototype.testMathmlScriptRules = function() {98 this.executeRuleTest('<msup><mi>R</mi><mi>n</mi></msup>', 'msup');99 this.executeRuleTest('<msub><mi>Z</mi><mi>n</mi></msub>', 'msub');100 this.executeRuleTest(101 '<msubsup><mi>Z</mi><mi>n</mi><mi>r</mi></msubsup>', 'msubsup');102 this.executeRuleTest(103 '<munder><mrow><mi>x</mi><mo>+</mo><mi>y</mi></mrow>' +104 '<mo>&#x23DF;</mo></munder>', 'munder');105 this.executeRuleTest(106 '<mover><mrow><mi>x</mi><mo>+</mo><mi>y</mi></mrow>' +107 '<mo>&#x23DE;</mo></mover>', 'mover');108 this.executeRuleTest(109 '<munderover><mo>&#x222B;</mo><mn>0</mn><mi>&#x221E;</mi></munderover>',110 'munderover');111};112/**113 * Test MathML rules for layout elements.114 * @export115 */116cvox.MathmlStoreTest.prototype.testMathmlLayoutRules = function() {117 this.executeRuleTest('<mrow><mi>x</mi><mo>+</mo><mi>y</mi></mrow>', 'mrow');118 this.executeRuleTest('<msqrt><mi>x</mi></msqrt>', 'msqrt');119 this.executeRuleTest('<mroot><mi>x</mi><mn>3</mn></mroot>', 'mroot');120 this.executeRuleTest('<mfrac><mn>1</mn><mi>n<mi></mfrac>', 'mfrac');121};122/**123 * Test MathML specialist rules for square, cube, etc.124 * @export125 */126cvox.MathmlStoreTest.prototype.testMathmlSpecializationRules = function() {127 this.executeRuleTest('<msup><mi>Z</mi><mn>2</mn></msup>', 'square');128 this.executeRuleTest(129 '<msup><mi>Z</mi><mrow><mn>2</mn></mrow></msup>', 'square');130 this.executeRuleTest('<msup><mi>Z</mi><mn>3</mn></msup>', 'cube');131 this.executeRuleTest(132 '<msup><mi>Z</mi><mrow><mn>3</mn></mrow></msup>', 'cube');133 this.executeRuleTest(134 '<msubsup><mi>Z</mi><mi>n</mi><mn>2</mn></msubsup>', 'square-sub');135 this.executeRuleTest(136 '<msubsup><mi>Z</mi><mi>n</mi><mrow><mn>2</mn></mrow></msubsup>',137 'square-sub');138 this.executeRuleTest(139 '<msubsup><mi>Z</mi><mi>n</mi><mn>3</mn></msubsup>', 'cube-sub');140 this.executeRuleTest(141 '<msubsup><mi>Z</mi><mi>n</mi><mrow><mn>3</mn></mrow></msubsup>',142 'cube-sub');143};144/**145 * Test MathML rules involving mfenced expressions.146 * @export147 */148cvox.MathmlStoreTest.prototype.testMathmlMfencedRules = function() {149 this.executeRuleTest(150 '<mfenced open="{" close="}" separators=";"><mi>a</mi><mi>b</mi>' +151 '<mi>c</mi><mi>d</mi><mi>e</mi></mfenced>', 'mfenced-single');152 this.executeRuleTest(153 '<mfenced open="{" close="}" separators=" "><mi>a</mi><mi>b</mi>' +154 '<mi>c</mi><mi>d</mi><mi>e</mi></mfenced>', 'mfenced-empty');155 this.executeRuleTest('<mfenced open="{" close="}"><mi>a</mi><mi>b</mi>' +156 '<mi>c</mi><mi>d</mi><mi>e</mi></mfenced>', 'mfenced-comma');157 this.executeRuleTest(158 '<mfenced open="{" close="}" separators=";;,"><mi>a</mi><mi>b</mi>' +159 '<mi>c</mi><mi>d</mi><mi>e</mi></mfenced>', 'mfenced-multi');160};161/**162 * Test MathML rules involving matrix expressions.163 * @export164 */165cvox.MathmlStoreTest.prototype.testMathmlMtableRules = function() {166 this.executeRuleTest(167 '<mtable><mtr><mtd><mi>A</mi></mtd><mtd><mi>B</mi></mtd></mtr>' +168 '<mtr><mtd><mi>C</mi></mtd><mtd><mi>D</mi></mtd></mtr>', 'mtable');169 this.executeRuleTest(170 '<mtr><mtd><mi>A</mi></mtd><mtd><mi>B</mi></mtd></mtr>', 'mtr');171 this.executeRuleTest('<mtd><mi>A</mi></mtd>', 'mtd');172};173/**174 * Test MathML rules involving mmultiscripts expressions.175 * @export176 */177cvox.MathmlStoreTest.prototype.testMathmlMultiscriptRules = function() {178 this.executeRuleTest(179 '<mmultiscripts><mi>A</mi><mn>1</mn><mn>2</mn>' +180 '<mprescripts/><mn>3</mn><mn>4</mn>', 'mmultiscripts-4');181 this.executeRuleTest(182 '<mmultiscripts><mi>A</mi><none/><mn>2</mn>' +183 '<mprescripts/><mn>3</mn><mn>4</mn>', 'mmultiscripts-3-1');184 this.executeRuleTest(185 '<mmultiscripts><mi>A</mi><mn>1</mn><none/>' +186 '<mprescripts/><mn>3</mn><mn>4</mn>', 'mmultiscripts-3-2');187 this.executeRuleTest(188 '<mmultiscripts><mi>A</mi><mn>1</mn><mn>2</mn>' +189 '<mprescripts/><none/><mn>4</mn>', 'mmultiscripts-3-3');190 this.executeRuleTest(191 '<mmultiscripts><mi>A</mi><mn>1</mn><mn>2</mn>' +192 '<mprescripts/><mn>3</mn><none/>', 'mmultiscripts-3-4');193 this.executeRuleTest(194 '<mmultiscripts><mi>A</mi><none/><none/>' +195 '<mprescripts/><mn>3</mn><mn>4</mn>', 'mmultiscripts-2-1');196 this.executeRuleTest(197 '<mmultiscripts><mi>A</mi><none/><none/>' +198 '<mprescripts/><none/><mn>4</mn>', 'mmultiscripts-1-1');199 this.executeRuleTest(200 '<mmultiscripts><mi>A</mi><none/><none/>' +201 '<mprescripts/><mn>3</mn><none/>', 'mmultiscripts-1-2');...

Full Screen

Full Screen

wash_terminal_window.js

Source:wash_terminal_window.js Github

copy

Full Screen

1// Copyright (c) 2012 The Chromium OS 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'use strict';5/**6 * A platform-app window containing an instance of hterm, running a7 * wam executable.8 */9wash.TerminalWindow = function(app) {10 this.app = app;11 console.log('wash: New terminal window.');12 this.wmWindow_ = app.wm.createWindow({id: 'wash'},13 this.onWindowCreated_.bind(this));14 /**15 * @type {hterm.Terminal}16 */17 this.term = null;18 /**19 * Event we invoke when async init is complete.20 */21 this.onInit = new lib.Event(this.onInit_.bind(this));22};23wash.TerminalWindow.prototype.defaultEnv = {TERM: 'xterm-256color'};24/**25 * The command to execute at startup.26 *27 * This must exist in the app filesystem, since we can't have mounted any28 * remote filesystems yet.29 */30wash.TerminalWindow.prototype.commandPath = '/apps/wash/exe/wash';31/**32 * The arg for the default command.33 */34wash.TerminalWindow.prototype.commandArg = null;35/**36 * Called when the platform app window is created.37 */38wash.TerminalWindow.prototype.onWindowCreated_ = function(contentNode) {39 this.contentNode_ = contentNode;40 this.document_ = contentNode.ownerDocument;41 this.document_.defaultView.addEventListener42 ('resize', this.onResize_.bind(this));43 this.document_.querySelector('#wash_window_close').addEventListener44 ('click', function() { this.executeContext.closeOk(null) }.bind(this));45 this.onResize_();46 this.term = new hterm.Terminal();47 this.term.onTerminalReady = this.onInit;48 this.term.decorate(contentNode);49 this.term.installKeyboard();50 this.term.io.onVTKeystroke = this.term.io.sendString =51 this.onSendString_.bind(this);52 this.term.io.onTerminalResize = this.onTerminalResize_.bind(this);53 this.document_.defaultView.addEventListener(54 'keydown', this.onKeyDown_.bind(this));55};56wash.TerminalWindow.prototype.print = function(str) {57 this.term.io.print(str);58};59wash.TerminalWindow.prototype.println = function(str) {60 this.term.io.println(str);61};62/**63 * Window initialization is done.64 */65wash.TerminalWindow.prototype.onInit_ = function() {66 this.executeContext = this.app.jsfs.defaultBinding.createExecuteContext();67 this.executeContext.setEnvs(this.defaultEnv);68 this.executeContext.onClose.addListener(this.onExecuteClose_, this);69 this.executeContext.onStdOut.addListener(this.onStdOut_, this);70 this.executeContext.onStdErr.addListener(this.onStdOut_, this);71 this.executeContext.onTTYRequest.addListener(this.onTTYRequest_, this);72 this.executeContext.setTTY73 ({rows: this.term.io.rowCount,74 columns: this.term.io.columnCount75 });76 this.executeContext.onReady.addListener(function() {77 console.log('TerminalWindow: execute ready');78 });79 this.executeContext.onClose.addListener(function(reason, value) {80 console.log('TerminalWindow: execute closed: ' + reason +81 JSON.stringify(value));82 });83 console.log('TerminalWindow: execute: ' + this.commandPath);84 this.executeContext.execute(this.commandPath, this.commandArg);85};86/**87 * The default command exited.88 */89wash.TerminalWindow.prototype.onExecuteClose_ = function(reason, value) {90 if (reason == 'ok') {91 this.wmWindow_.close();92 } else {93 this.print('Error executing ' + this.commandPath + ': ' +94 JSON.stringify(value));95 }96};97wash.TerminalWindow.prototype.onTTYRequest_ = function(request) {98 console.log('tty request');99 if (typeof request.interrupt == 'string')100 this.executeContext.setTTY({interrupt: request.interrupt});101};102/**103 * Handle for inbound messages from the default command.104 */105wash.TerminalWindow.prototype.onStdOut_ = function(str, opt_onAck) {106 if (typeof str == 'string') {107 str = str.replace(/\n/g, '\r\n');108 } else {109 str = JSON.stringify(str) + '\r\n';110 }111 this.print(str);112 if (opt_onAck)113 opt_onAck();114};115/**116 * Called by hterm.Terminal.IO for keyboard events.117 *118 * We just forward them on to the default command.119 */120wash.TerminalWindow.prototype.onSendString_ = function(str) {121 if (this.executeContext.isReadyState('READY')) {122 var interruptChar = this.executeContext.getTTY().interrupt;123 if (interruptChar && str == interruptChar) {124 console.log('interrupt');125 wam.async(function() {126 this.executeContext.signal('wam.FileSystem.Signal.Interrupt');127 }, [this]);128 } else {129 wam.async(function() { this.executeContext.stdin(str) }, [this]);130 }131 } else {132 console.warn('Execute not ready, ignoring input: ' + str);133 }134};135/**136 * Called by hterm.Terminal.IO when the terminal size changes.137 *138 * We just forward them on to the default command.139 */140wash.TerminalWindow.prototype.onTerminalResize_ = function(columns, rows) {141 if (this.executeContext && this.executeContext.isReadyState('READY'))142 this.executeContext.setTTY({columns: columns, rows: rows});143};144/**145 * Our own keyboard accelerators.146 */147wash.TerminalWindow.prototype.onKeyDown_ = function(e) {148 if (e.ctrlKey && e.shiftKey && e.keyCode == ('R').charCodeAt())149 chrome.runtime.reload();150};151/**152 * Platform app window size changed.153 */154wash.TerminalWindow.prototype.onResize_ = function() {155 var bodyRect = this.document_.body.getBoundingClientRect();156 var contentRect = this.contentNode_.getBoundingClientRect();157 this.contentNode_.style.height = (bodyRect.height - contentRect.top) + 'px';...

Full Screen

Full Screen

sp_nacl.js

Source:sp_nacl.js Github

copy

Full Screen

1// Copyright (c) 2014 The Chromium OS 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'use strict';5sp.NaCl = function(mimeType, nmfURL, executeContext) {6 this.mimeType_ = mimeType;7 this.nmfURL_ = nmfURL;8 this.executeContext = executeContext;9 this.document_ = window.document;10 this.posixArgs_ = executeContext.arg;11 if (!(this.posixArgs_ instanceof Array)) {12 if (this.posixArgs_ != null) {13 executeContext.closeError('wam.FileSystem.Error.UnexpectedArgvType',14 ['array']);15 return;16 }17 this.posixArgs_ = [];18 }19 this.run();20};21sp.NaCl.prototype.run = function() {22 var document = this.document_;23 var plugin = document.createElement('object');24 this.plugin_ = plugin;25 plugin.addEventListener('load', this.onPluginLoad_.bind(this));26 plugin.addEventListener('error', this.onPluginLoadError_.bind(this));27 plugin.addEventListener('abort', this.onPluginLoadAbort_.bind(this));28 plugin.addEventListener('progress', this.onPluginProgress_.bind(this));29 plugin.addEventListener('crash', this.onPluginCrash_.bind(this));30 plugin.addEventListener('message', this.onPluginMessage_.bind(this));31 plugin.setAttribute('src', this.nmfURL_);32 plugin.setAttribute('type', this.mimeType_);33 plugin.setAttribute('width', 0);34 plugin.setAttribute('height', 0);35 var tty = this.executeContext.getTTY();36 var lastSlash = this.nmfURL_.lastIndexOf('/');37 var nmfBase = this.nmfURL_.substr(lastSlash + 1);38 var params = {39 arg0: nmfBase,40 PS_TTY_PREFIX: 'stdio',41 PS_TTY_RESIZE: 'tty_resize',42 PS_TTY_COLS: tty.columns,43 PS_TTY_ROWS: tty.rows,44 PS_STDIN: '/dev/tty',45 PS_STDOUT: '/dev/tty',46 PS_STDERR: '/dev/tty',47 PS_VERBOSITY: '2',48 PS_EXIT_MESSAGE: 'exited',49 };50 var env = this.executeContext.getEnvs();51 for (var key in env) {52 if (!params.hasOwnProperty(key))53 params[key] = env[key];54 }55 for (var i = 0; i < this.posixArgs_.length; i++) {56 params['arg' + (i + 1)] = this.posixArgs_[i];57 }58 for (var key in params) {59 var param = document.createElement('param');60 param.name = key;61 param.value = params[key];62 plugin.appendChild(param);63 }64 this.executeContext.onStdIn.addListener(this.onStdIn_.bind(this));65 this.executeContext.onTTYChange.addListener(this.onTTYChange_.bind(this));66 this.executeContext.onClose.addListener(this.onExecuteClose_.bind(this));67 this.executeContext.ready();68 this.executeContext.stdout('Loading.');69 document.body.appendChild(plugin);70 // Set mimetype twice for http://crbug.com/37105971 plugin.setAttribute('type', this.mimeType_);72};73sp.NaCl.prototype.onPluginProgress_ = function(e) {74 var message;75 if (e.lengthComputable && e.total) {76 var percent = Math.round(e.loaded * 100 / e.total);77 var kbloaded = Math.round(e.loaded / 1024);78 var kbtotal = Math.round(e.total / 1024);79 message = '\r\x1b[KLoading [' +80 kbloaded + ' KiB/' +81 kbtotal + ' KiB ' +82 percent + '%]';83 } else {84 message = '.';85 }86 this.executeContext.stdout(message);87};88sp.NaCl.prototype.onPluginLoad_ = function() {89 this.executeContext.stdout('\r\x1b[K');90 this.executeContext.requestTTY({interrupt: ''});91};92sp.NaCl.prototype.onPluginLoadError_ = function(e) {93 this.executeContext.stdout(' ERROR.\n');94 this.executeContext.closeError('wam.FileSystem.Error.RuntimeError',95 ['Plugin load error.']);96};97sp.NaCl.prototype.onPluginLoadAbort_ = function() {98 this.executeContext.stdout(' ABORT.\n');99 this.executeContext.closeError('wam.FileSystem.Error.RuntimeError',100 ['Plugin load abort.']);101};102sp.NaCl.prototype.onPluginCrash_ = function() {103 if (this.executeContext.isOpen) {104 this.executeContext.closeError('wam.FileSystem.Error.RuntimeError',105 ['Plugin crash: exit code: ' +106 this.plugin_.exitStatus]);107 }108};109sp.NaCl.prototype.onPluginMessage_ = function(e) {110 var ary;111 if ((ary = e.data.match(/^stdio(.*)/))) {112 // Substr instead of ary[1] so we get newlines too.113 this.executeContext.stdout(e.data.substr(5));114 } else if ((ary = e.data.match(/^exited:(-?\d+)/))) {115 this.executeContext.closeOk(parseInt(ary[1]));116 }117};118sp.NaCl.prototype.onStdIn_ = function(value) {119 if (typeof value != 'string')120 return;121 var msg = {};122 msg['stdio'] = value;123 this.plugin_.postMessage(msg);124};125sp.NaCl.prototype.onTTYChange_ = function() {126 var tty = this.executeContext.getTTY();127 this.plugin_.postMessage({'tty_resize': [ tty.columns, tty.rows ]});128};129sp.NaCl.prototype.onExecuteClose_ = function(reason, value) {130 this.plugin_.parentElement.removeChild(this.plugin_);...

Full Screen

Full Screen

wam_remote_fs_execute.js

Source:wam_remote_fs_execute.js Github

copy

Full Screen

1// Copyright (c) 2014 The Chromium OS 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'use strict';5/**6 * Request/Response classes to marshal an wam.binding.fs.ExecuteContext over a7 * wam channel.8 */9wam.remote.fs.execute = {};10wam.remote.fs.execute.Request = function(handshakeRequest, executeContext) {11 this.handshakeRequest = handshakeRequest;12 this.executeContext = executeContext;13 this.readyRequest = new wam.remote.ready.Request(executeContext);14 this.readyRequest.onMessage.addListener(this.onMessage_.bind(this));15 executeContext.dependsOn(handshakeRequest.readyRequest.readyBinding);16 executeContext.onExecute.addListener(this.onExecute_.bind(this));17 executeContext.onTTYChange.addListener(this.onTTYChange_.bind(this));18 executeContext.onStdIn.addListener(this.onStdIn_.bind(this));19 executeContext.onSignal.addListener(this.onSignal_.bind(this));20};21wam.remote.fs.execute.Request.prototype.onExecute_ = function() {22 var outMessage = this.handshakeRequest.readyRequest.createMessage(23 'execute',24 {'path': this.executeContext.path,25 'execArg': this.executeContext.arg,26 'execEnv': this.executeContext.env_,27 'tty': this.executeContext.tty_28 });29 this.readyRequest.sendRequest(outMessage);30};31wam.remote.fs.execute.Request.prototype.onStdIn_ = function(value) {32 this.readyRequest.send('stdin', value);33};34wam.remote.fs.execute.Request.prototype.onSignal_ = function(name) {35 this.readyRequest.send('signal', name);36};37wam.remote.fs.execute.Request.prototype.onTTYChange_ = function(tty) {38 if (this.readyRequest.readyBinding.isOpen)39 this.readyRequest.send('tty-change', tty);40};41wam.remote.fs.execute.Request.prototype.onMessage_ = function(inMessage) {42 if (inMessage.name == 'stdout' || inMessage.name == 'stderr') {43 var onAck = null;44 if (inMessage.isOpen) {45 onAck = function(value) {46 inMessage.replyOk(typeof value == 'undefined' ? null : value);47 };48 }49 if (inMessage.name == 'stdout') {50 this.executeContext.stdout(inMessage.arg, onAck);51 } else {52 this.executeContext.stderr(inMessage.arg, onAck);53 }54 } else if (inMessage.name == 'tty-request') {55 this.executeContext.requestTTY(inMessage.arg);56 } else if (inMessage.name != 'stdout' && inMessage.name != 'stderr' &&57 !inMessage.isFinalReply) {58 console.warn('remote execute request received unexpected message: ' +59 inMessage.name, inMessage.arg);60 if (inMessage.isOpen) {61 inMessage.replyError('wam.UnexpectedMessage',62 [inMessage.name, inMessage.arg]);63 }64 }65};66/**67 *68 */69wam.remote.fs.execute.Response = function(inMessage, executeContext) {70 this.inMessage = inMessage;71 this.executeContext = executeContext;72 this.executeContext.onStdOut.addListener(this.onStdOut_, this);73 this.executeContext.onStdErr.addListener(this.onStdErr_, this);74 this.executeContext.onTTYRequest.addListener(this.onTTYRequest_.bind(this));75 this.readyResponse = new wam.remote.ready.Response(inMessage, executeContext);76 this.readyResponse.onMessage.addListener(this.onMessage_.bind(this));77};78wam.remote.fs.execute.Response.prototype.onMessage_ = function(inMessage) {79 switch (inMessage.name) {80 case 'stdin':81 var onAck = null;82 if (inMessage.isOpen) {83 onAck = function(value) {84 inMessage.replyOk(typeof value == 'undefined' ? null : value);85 };86 }87 this.executeContext.stdin(inMessage.arg, onAck);88 break;89 case 'tty-change':90 this.executeContext.setTTY(inMessage.arg);91 break;92 case 'signal':93 this.executeContext.signal(inMessage.arg.name, inMessage.arg.value);94 break;95 }96};97wam.remote.fs.execute.Response.prototype.onTTYRequest_ = function(value) {98 this.readyResponse.send('tty-request', value);99};100wam.remote.fs.execute.Response.prototype.onStdOut_ = function(value, onAck) {101 this.readyResponse.send('stdout', value,102 (onAck ?103 function(inMessage) { onAck(inMessage.arg) } :104 null));105};106wam.remote.fs.execute.Response.prototype.onStdErr_ = function(value, onAck) {107 this.readyResponse.send('stderr', value,108 (onAck ?109 function(inMessage) { onAck(inMessage.arg) } :110 null));...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const { exec } = require('child_process');2exec('node ./node_modules/.bin/wdio wdio.conf.js', (error, stdout, stderr) => {3 if (error) {4 console.log(`error: ${error.message}`);5 return;6 }7 if (stderr) {8 console.log(`stderr: ${stderr}`);9 return;10 }11 console.log(`stdout: ${stdout}`);12});13 {

Full Screen

Using AI Code Generation

copy

Full Screen

1driver.init({2}).then(function () {3 driver.execute("mobile: scroll", {direction: 'down'})4}).then(function () {5 driver.execute("mobile: scroll", {direction: 'up'})6}).then(function () {7 driver.execute("mobile: scroll", {direction: 'left'})8}).then(function () {9 driver.execute("mobile: scroll", {direction: 'right'})10}).then(function () {11 driver.execute("mobile: scroll", {direction: 'down'})12}).then(function () {13 driver.execute("mobile: scroll", {direction: 'up'})14}).then(function () {15 driver.execute("mobile: scroll", {direction: 'left'})16}).then(function () {17 driver.execute("mobile: scroll", {direction: 'right'})18}).then(function () {19 driver.execute("mobile: scroll", {direction: 'down'})20}).then(function () {21 driver.execute("mobile: scroll", {direction: 'up'})22}).then(function () {23 driver.execute("mobile: scroll", {direction: 'left'})24}).then(function () {25 driver.execute("mobile: scroll", {direction: 'right'})26}).then(function () {27 driver.execute("mobile: scroll", {direction: 'down'})28}).then(function () {29 driver.execute("mobile: scroll", {direction: 'up'})30}).then(function () {31 driver.execute("mobile: scroll", {direction: 'left'})32}).then(function () {33 driver.execute("mobile: scroll", {direction: 'right'})34}).then(function () {

Full Screen

Using AI Code Generation

copy

Full Screen

1var webdriver = require('selenium-webdriver');2var By = webdriver.By;3var until = webdriver.until;4var driver = new webdriver.Builder().forBrowser('selenium-appium').build();5driver.findElement(By.name('q')).sendKeys('webdriver');6driver.findElement(By.name('btnG')).click();7driver.wait(until.titleIs('webdriver - Google Search'), 1000);8driver.quit();9var webdriver = require('selenium-webdriver');10var By = webdriver.By;11var until = webdriver.until;12var driver = new webdriver.Builder().forBrowser('selenium-appium').build();13driver.findElement(By.name('q')).sendKeys('webdriver');14driver.findElement(By.name('btnG')).click();15driver.wait(until.titleIs('webdriver - Google Search'), 1000);16driver.quit();17var webdriver = require('selenium-webdriver');18var By = webdriver.By;19var until = webdriver.until;20var driver = new webdriver.Builder().forBrowser('selenium-appium').build();21driver.findElement(By.name('q')).sendKeys('webdriver');22driver.findElement(By.name('btnG')).click();23driver.wait(until.titleIs('webdriver - Google Search'), 1000);24driver.quit();25var webdriver = require('selenium-webdriver');26var By = webdriver.By;27var until = webdriver.until;28var driver = new webdriver.Builder().forBrowser('selenium-appium').build();29driver.findElement(By.name('q')).sendKeys('webdriver');30driver.findElement(By.name('btnG')).click();31driver.wait(until.titleIs('webdriver - Google Search'), 1000);32driver.quit();33var webdriver = require('selenium-webdriver');34var By = webdriver.By;35var until = webdriver.until;36var driver = new webdriver.Builder().forBrowser('selenium-appium').build();37driver.get('

Full Screen

Using AI Code Generation

copy

Full Screen

1this.execute('findElement', ['accessibility id', 'test'], function(err, elementId) {2 console.log(elementId);3 this.execute('click', [elementId], function(err, res) {4 console.log(res);5 });6});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Appium Xcuitest Driver automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Sign up Free
_

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful