text.xml 297 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094
  1. <xml xmlns="http://www.w3.org/1999/xhtml">
  2. <block type="unittest_main" x="13" y="13">
  3. <statement name="DO">
  4. <block type="procedures_callnoreturn">
  5. <mutation name="test length"></mutation>
  6. <next>
  7. <block type="procedures_callnoreturn">
  8. <mutation name="test empty"></mutation>
  9. <next>
  10. <block type="procedures_callnoreturn">
  11. <mutation name="test create"></mutation>
  12. <next>
  13. <block type="procedures_callnoreturn">
  14. <mutation name="test append"></mutation>
  15. <next>
  16. <block type="procedures_callnoreturn">
  17. <mutation name="test find simple"></mutation>
  18. <next>
  19. <block type="procedures_callnoreturn">
  20. <mutation name="test find complex"></mutation>
  21. <next>
  22. <block type="procedures_callnoreturn">
  23. <mutation name="test get simple"></mutation>
  24. <next>
  25. <block type="procedures_callnoreturn">
  26. <mutation name="test get complex"></mutation>
  27. <next>
  28. <block type="procedures_callnoreturn">
  29. <mutation name="test substring simple"></mutation>
  30. <next>
  31. <block type="procedures_callnoreturn">
  32. <mutation name="test substring complex"></mutation>
  33. <next>
  34. <block type="procedures_callnoreturn">
  35. <mutation name="test case"></mutation>
  36. <next>
  37. <block type="procedures_callnoreturn">
  38. <mutation name="test trim"></mutation>
  39. </block>
  40. </next>
  41. </block>
  42. </next>
  43. </block>
  44. </next>
  45. </block>
  46. </next>
  47. </block>
  48. </next>
  49. </block>
  50. </next>
  51. </block>
  52. </next>
  53. </block>
  54. </next>
  55. </block>
  56. </next>
  57. </block>
  58. </next>
  59. </block>
  60. </next>
  61. </block>
  62. </statement>
  63. </block>
  64. <block type="procedures_defnoreturn" x="13" y="388">
  65. <mutation>
  66. <arg name="test name"></arg>
  67. </mutation>
  68. <field name="NAME">check number of calls</field>
  69. <comment pinned="false" h="69" w="256">Checks that the number of calls is one in order to confirm that a function was only called once.</comment>
  70. <statement name="STACK">
  71. <block type="text_append">
  72. <field name="VAR">test name</field>
  73. <value name="TEXT">
  74. <block type="text">
  75. <field name="TEXT">number of calls</field>
  76. </block>
  77. </value>
  78. <next>
  79. <block type="unittest_assertequals">
  80. <value name="MESSAGE">
  81. <block type="variables_get">
  82. <field name="VAR">test name</field>
  83. </block>
  84. </value>
  85. <value name="ACTUAL">
  86. <block type="variables_get">
  87. <field name="VAR">number of calls</field>
  88. </block>
  89. </value>
  90. <value name="EXPECTED">
  91. <block type="math_number">
  92. <field name="NUM">1</field>
  93. </block>
  94. </value>
  95. </block>
  96. </next>
  97. </block>
  98. </statement>
  99. </block>
  100. <block type="procedures_defnoreturn" x="13" y="563">
  101. <field name="NAME">test create</field>
  102. <comment pinned="false" h="80" w="160">Tests the "create text with" block with varying number of inputs.</comment>
  103. <statement name="STACK">
  104. <block type="unittest_assertequals" inline="false">
  105. <value name="MESSAGE">
  106. <block type="text">
  107. <field name="TEXT">no text</field>
  108. </block>
  109. </value>
  110. <value name="ACTUAL">
  111. <block type="text_join" inline="false">
  112. <mutation items="0"></mutation>
  113. </block>
  114. </value>
  115. <value name="EXPECTED">
  116. <block type="text">
  117. <field name="TEXT"></field>
  118. </block>
  119. </value>
  120. <next>
  121. <block type="unittest_assertequals" inline="false">
  122. <value name="MESSAGE">
  123. <block type="text">
  124. <field name="TEXT">create single</field>
  125. </block>
  126. </value>
  127. <value name="ACTUAL">
  128. <block type="text_join" inline="false">
  129. <mutation items="1"></mutation>
  130. <value name="ADD0">
  131. <block type="text">
  132. <field name="TEXT">Hello</field>
  133. </block>
  134. </value>
  135. </block>
  136. </value>
  137. <value name="EXPECTED">
  138. <block type="text">
  139. <field name="TEXT">Hello</field>
  140. </block>
  141. </value>
  142. <next>
  143. <block type="unittest_assertequals" inline="false">
  144. <value name="MESSAGE">
  145. <block type="text">
  146. <field name="TEXT">create single number</field>
  147. </block>
  148. </value>
  149. <value name="ACTUAL">
  150. <block type="text_join" inline="false">
  151. <mutation items="1"></mutation>
  152. <value name="ADD0">
  153. <block type="math_number">
  154. <field name="NUM">-1</field>
  155. </block>
  156. </value>
  157. </block>
  158. </value>
  159. <value name="EXPECTED">
  160. <block type="text">
  161. <field name="TEXT">-1</field>
  162. </block>
  163. </value>
  164. <next>
  165. <block type="unittest_assertequals" inline="false">
  166. <value name="MESSAGE">
  167. <block type="text">
  168. <field name="TEXT">create double text</field>
  169. </block>
  170. </value>
  171. <value name="ACTUAL">
  172. <block type="text_join" inline="true">
  173. <mutation items="2"></mutation>
  174. <value name="ADD0">
  175. <block type="text">
  176. <field name="TEXT">K</field>
  177. </block>
  178. </value>
  179. <value name="ADD1">
  180. <block type="math_number">
  181. <field name="NUM">9</field>
  182. </block>
  183. </value>
  184. </block>
  185. </value>
  186. <value name="EXPECTED">
  187. <block type="text">
  188. <field name="TEXT">K9</field>
  189. </block>
  190. </value>
  191. <next>
  192. <block type="unittest_assertequals" inline="false">
  193. <value name="MESSAGE">
  194. <block type="text">
  195. <field name="TEXT">create double text numbers</field>
  196. </block>
  197. </value>
  198. <value name="ACTUAL">
  199. <block type="text_join" inline="true">
  200. <mutation items="2"></mutation>
  201. <value name="ADD0">
  202. <block type="math_number">
  203. <field name="NUM">4</field>
  204. </block>
  205. </value>
  206. <value name="ADD1">
  207. <block type="math_number">
  208. <field name="NUM">2</field>
  209. </block>
  210. </value>
  211. </block>
  212. </value>
  213. <value name="EXPECTED">
  214. <block type="text">
  215. <field name="TEXT">42</field>
  216. </block>
  217. </value>
  218. <next>
  219. <block type="unittest_assertequals" inline="false">
  220. <value name="MESSAGE">
  221. <block type="text">
  222. <field name="TEXT">create triple</field>
  223. </block>
  224. </value>
  225. <value name="ACTUAL">
  226. <block type="text_join" inline="true">
  227. <mutation items="3"></mutation>
  228. <value name="ADD0">
  229. <block type="math_number">
  230. <field name="NUM">1</field>
  231. </block>
  232. </value>
  233. <value name="ADD1">
  234. <block type="math_number">
  235. <field name="NUM">2</field>
  236. </block>
  237. </value>
  238. <value name="ADD2">
  239. <block type="math_number">
  240. <field name="NUM">3</field>
  241. </block>
  242. </value>
  243. </block>
  244. </value>
  245. <value name="EXPECTED">
  246. <block type="text">
  247. <field name="TEXT">123</field>
  248. </block>
  249. </value>
  250. <next>
  251. <block type="unittest_assertequals" inline="false">
  252. <value name="MESSAGE">
  253. <block type="text">
  254. <field name="TEXT">create order</field>
  255. </block>
  256. </value>
  257. <value name="ACTUAL">
  258. <block type="text_join" inline="false">
  259. <mutation items="3"></mutation>
  260. <value name="ADD0">
  261. <block type="math_number">
  262. <field name="NUM">1</field>
  263. </block>
  264. </value>
  265. <value name="ADD1">
  266. <block type="logic_ternary" inline="true">
  267. <value name="IF">
  268. <block type="logic_boolean">
  269. <field name="BOOL">TRUE</field>
  270. </block>
  271. </value>
  272. <value name="THEN">
  273. <block type="math_number">
  274. <field name="NUM">0</field>
  275. </block>
  276. </value>
  277. <value name="ELSE">
  278. <block type="logic_null"></block>
  279. </value>
  280. </block>
  281. </value>
  282. <value name="ADD2">
  283. <block type="text">
  284. <field name="TEXT">M</field>
  285. </block>
  286. </value>
  287. </block>
  288. </value>
  289. <value name="EXPECTED">
  290. <block type="text">
  291. <field name="TEXT">10M</field>
  292. </block>
  293. </value>
  294. </block>
  295. </next>
  296. </block>
  297. </next>
  298. </block>
  299. </next>
  300. </block>
  301. </next>
  302. </block>
  303. </next>
  304. </block>
  305. </next>
  306. </block>
  307. </statement>
  308. </block>
  309. <block type="procedures_defreturn" x="13" y="1263">
  310. <mutation statements="false"></mutation>
  311. <field name="NAME">get empty</field>
  312. <comment pinned="false" h="80" w="160">Creates an empty string for use with the empty test.</comment>
  313. <value name="RETURN">
  314. <block type="text">
  315. <field name="TEXT"></field>
  316. </block>
  317. </value>
  318. </block>
  319. <block type="procedures_defnoreturn" x="13" y="1338">
  320. <field name="NAME">test empty</field>
  321. <comment pinned="false" h="80" w="160">Tests the "is empty" block".</comment>
  322. <statement name="STACK">
  323. <block type="unittest_assertvalue" inline="false">
  324. <field name="EXPECTED">FALSE</field>
  325. <value name="MESSAGE">
  326. <block type="text">
  327. <field name="TEXT">not empty</field>
  328. </block>
  329. </value>
  330. <value name="ACTUAL">
  331. <block type="text_isEmpty" inline="true">
  332. <value name="VALUE">
  333. <block type="text">
  334. <field name="TEXT">Google</field>
  335. </block>
  336. </value>
  337. </block>
  338. </value>
  339. <next>
  340. <block type="unittest_assertvalue" inline="false">
  341. <field name="EXPECTED">TRUE</field>
  342. <value name="MESSAGE">
  343. <block type="text">
  344. <field name="TEXT">empty</field>
  345. </block>
  346. </value>
  347. <value name="ACTUAL">
  348. <block type="text_isEmpty" inline="true">
  349. <value name="VALUE">
  350. <block type="text">
  351. <field name="TEXT"></field>
  352. </block>
  353. </value>
  354. </block>
  355. </value>
  356. <next>
  357. <block type="unittest_assertvalue" inline="false">
  358. <field name="EXPECTED">TRUE</field>
  359. <value name="MESSAGE">
  360. <block type="text">
  361. <field name="TEXT">empty complex</field>
  362. </block>
  363. </value>
  364. <value name="ACTUAL">
  365. <block type="text_isEmpty" inline="true">
  366. <value name="VALUE">
  367. <block type="procedures_callreturn">
  368. <mutation name="get empty"></mutation>
  369. </block>
  370. </value>
  371. </block>
  372. </value>
  373. <next>
  374. <block type="unittest_assertvalue" inline="false">
  375. <field name="EXPECTED">TRUE</field>
  376. <value name="MESSAGE">
  377. <block type="text">
  378. <field name="TEXT">empty order</field>
  379. </block>
  380. </value>
  381. <value name="ACTUAL">
  382. <block type="text_isEmpty" inline="true">
  383. <value name="VALUE">
  384. <block type="logic_ternary" inline="true">
  385. <value name="IF">
  386. <block type="logic_boolean">
  387. <field name="BOOL">TRUE</field>
  388. </block>
  389. </value>
  390. <value name="THEN">
  391. <block type="text">
  392. <field name="TEXT"></field>
  393. </block>
  394. </value>
  395. <value name="ELSE">
  396. <block type="logic_null"></block>
  397. </value>
  398. </block>
  399. </value>
  400. </block>
  401. </value>
  402. </block>
  403. </next>
  404. </block>
  405. </next>
  406. </block>
  407. </next>
  408. </block>
  409. </statement>
  410. </block>
  411. <block type="procedures_defnoreturn" x="13" y="1663">
  412. <field name="NAME">test length</field>
  413. <comment pinned="false" h="80" w="160">Tests the "length" block.</comment>
  414. <statement name="STACK">
  415. <block type="unittest_assertequals" inline="false">
  416. <value name="MESSAGE">
  417. <block type="text">
  418. <field name="TEXT">zero length</field>
  419. </block>
  420. </value>
  421. <value name="ACTUAL">
  422. <block type="text_length" inline="false">
  423. <value name="VALUE">
  424. <block type="text">
  425. <field name="TEXT"></field>
  426. </block>
  427. </value>
  428. </block>
  429. </value>
  430. <value name="EXPECTED">
  431. <block type="math_number">
  432. <field name="NUM">0</field>
  433. </block>
  434. </value>
  435. <next>
  436. <block type="unittest_assertequals" inline="false">
  437. <value name="MESSAGE">
  438. <block type="text">
  439. <field name="TEXT">non-zero length</field>
  440. </block>
  441. </value>
  442. <value name="ACTUAL">
  443. <block type="text_length" inline="false">
  444. <value name="VALUE">
  445. <block type="text">
  446. <field name="TEXT">Google</field>
  447. </block>
  448. </value>
  449. </block>
  450. </value>
  451. <value name="EXPECTED">
  452. <block type="math_number">
  453. <field name="NUM">6</field>
  454. </block>
  455. </value>
  456. <next>
  457. <block type="unittest_assertequals" inline="false">
  458. <value name="MESSAGE">
  459. <block type="text">
  460. <field name="TEXT">length order</field>
  461. </block>
  462. </value>
  463. <value name="ACTUAL">
  464. <block type="text_length" inline="false">
  465. <value name="VALUE">
  466. <block type="logic_ternary" inline="true">
  467. <value name="IF">
  468. <block type="logic_boolean">
  469. <field name="BOOL">TRUE</field>
  470. </block>
  471. </value>
  472. <value name="THEN">
  473. <block type="text">
  474. <field name="TEXT">car</field>
  475. </block>
  476. </value>
  477. <value name="ELSE">
  478. <block type="logic_null"></block>
  479. </value>
  480. </block>
  481. </value>
  482. </block>
  483. </value>
  484. <value name="EXPECTED">
  485. <block type="math_number">
  486. <field name="NUM">3</field>
  487. </block>
  488. </value>
  489. </block>
  490. </next>
  491. </block>
  492. </next>
  493. </block>
  494. </statement>
  495. </block>
  496. <block type="procedures_defnoreturn" x="13" y="1963">
  497. <field name="NAME">test append</field>
  498. <comment pinned="false" h="80" w="160">Tests the "append text" block with different types of parameters.</comment>
  499. <statement name="STACK">
  500. <block type="variables_set" inline="false">
  501. <field name="VAR">item</field>
  502. <value name="VALUE">
  503. <block type="text">
  504. <field name="TEXT">Miserable</field>
  505. </block>
  506. </value>
  507. <next>
  508. <block type="text_append" inline="false">
  509. <field name="VAR">item</field>
  510. <value name="TEXT">
  511. <block type="text">
  512. <field name="TEXT">Failure</field>
  513. </block>
  514. </value>
  515. <next>
  516. <block type="unittest_assertequals" inline="false">
  517. <value name="MESSAGE">
  518. <block type="text">
  519. <field name="TEXT">append text</field>
  520. </block>
  521. </value>
  522. <value name="ACTUAL">
  523. <block type="variables_get">
  524. <field name="VAR">item</field>
  525. </block>
  526. </value>
  527. <value name="EXPECTED">
  528. <block type="text">
  529. <field name="TEXT">MiserableFailure</field>
  530. </block>
  531. </value>
  532. <next>
  533. <block type="variables_set" inline="false">
  534. <field name="VAR">item</field>
  535. <value name="VALUE">
  536. <block type="math_number">
  537. <field name="NUM">12</field>
  538. </block>
  539. </value>
  540. <next>
  541. <block type="text_append" inline="false">
  542. <field name="VAR">item</field>
  543. <value name="TEXT">
  544. <block type="math_number">
  545. <field name="NUM">34</field>
  546. </block>
  547. </value>
  548. <next>
  549. <block type="unittest_assertequals" inline="false">
  550. <value name="MESSAGE">
  551. <block type="text">
  552. <field name="TEXT">append number</field>
  553. </block>
  554. </value>
  555. <value name="ACTUAL">
  556. <block type="variables_get">
  557. <field name="VAR">item</field>
  558. </block>
  559. </value>
  560. <value name="EXPECTED">
  561. <block type="text">
  562. <field name="TEXT">1234</field>
  563. </block>
  564. </value>
  565. <next>
  566. <block type="variables_set" inline="false">
  567. <field name="VAR">item</field>
  568. <value name="VALUE">
  569. <block type="text">
  570. <field name="TEXT">Something </field>
  571. </block>
  572. </value>
  573. <next>
  574. <block type="text_append" inline="false">
  575. <field name="VAR">item</field>
  576. <value name="TEXT">
  577. <block type="logic_ternary" inline="true">
  578. <value name="IF">
  579. <block type="logic_boolean">
  580. <field name="BOOL">TRUE</field>
  581. </block>
  582. </value>
  583. <value name="THEN">
  584. <block type="text">
  585. <field name="TEXT">Positive</field>
  586. </block>
  587. </value>
  588. <value name="ELSE">
  589. <block type="logic_null"></block>
  590. </value>
  591. </block>
  592. </value>
  593. <next>
  594. <block type="unittest_assertequals" inline="false">
  595. <value name="MESSAGE">
  596. <block type="text">
  597. <field name="TEXT">append order</field>
  598. </block>
  599. </value>
  600. <value name="ACTUAL">
  601. <block type="variables_get">
  602. <field name="VAR">item</field>
  603. </block>
  604. </value>
  605. <value name="EXPECTED">
  606. <block type="text">
  607. <field name="TEXT">Something Positive</field>
  608. </block>
  609. </value>
  610. </block>
  611. </next>
  612. </block>
  613. </next>
  614. </block>
  615. </next>
  616. </block>
  617. </next>
  618. </block>
  619. </next>
  620. </block>
  621. </next>
  622. </block>
  623. </next>
  624. </block>
  625. </next>
  626. </block>
  627. </statement>
  628. </block>
  629. <block type="procedures_defnoreturn" x="13" y="2438">
  630. <field name="NAME">test find simple</field>
  631. <comment pinned="false" h="80" w="160">Tests the "find" block with a variable.</comment>
  632. <statement name="STACK">
  633. <block type="variables_set" inline="false">
  634. <field name="VAR">text</field>
  635. <value name="VALUE">
  636. <block type="text">
  637. <field name="TEXT">Banana</field>
  638. </block>
  639. </value>
  640. <next>
  641. <block type="unittest_assertequals" inline="false">
  642. <value name="MESSAGE">
  643. <block type="text">
  644. <field name="TEXT">find first simple</field>
  645. </block>
  646. </value>
  647. <value name="ACTUAL">
  648. <block type="text_indexOf">
  649. <field name="END">FIRST</field>
  650. <value name="VALUE">
  651. <block type="variables_get">
  652. <field name="VAR">text</field>
  653. </block>
  654. </value>
  655. <value name="FIND">
  656. <block type="text">
  657. <field name="TEXT">an</field>
  658. </block>
  659. </value>
  660. </block>
  661. </value>
  662. <value name="EXPECTED">
  663. <block type="unittest_adjustindex">
  664. <value name="INDEX">
  665. <block type="math_number">
  666. <field name="NUM">1</field>
  667. </block>
  668. </value>
  669. </block>
  670. </value>
  671. <next>
  672. <block type="unittest_assertequals" inline="false">
  673. <value name="MESSAGE">
  674. <block type="text">
  675. <field name="TEXT">find last simple</field>
  676. </block>
  677. </value>
  678. <value name="ACTUAL">
  679. <block type="text_indexOf">
  680. <field name="END">LAST</field>
  681. <value name="VALUE">
  682. <block type="variables_get">
  683. <field name="VAR">text</field>
  684. </block>
  685. </value>
  686. <value name="FIND">
  687. <block type="text">
  688. <field name="TEXT">an</field>
  689. </block>
  690. </value>
  691. </block>
  692. </value>
  693. <value name="EXPECTED">
  694. <block type="unittest_adjustindex">
  695. <value name="INDEX">
  696. <block type="math_number">
  697. <field name="NUM">3</field>
  698. </block>
  699. </value>
  700. </block>
  701. </value>
  702. <next>
  703. <block type="unittest_assertequals" inline="false">
  704. <value name="MESSAGE">
  705. <block type="text">
  706. <field name="TEXT">find none simple</field>
  707. </block>
  708. </value>
  709. <value name="ACTUAL">
  710. <block type="text_indexOf">
  711. <field name="END">FIRST</field>
  712. <value name="VALUE">
  713. <block type="variables_get">
  714. <field name="VAR">text</field>
  715. </block>
  716. </value>
  717. <value name="FIND">
  718. <block type="text">
  719. <field name="TEXT">Peel</field>
  720. </block>
  721. </value>
  722. </block>
  723. </value>
  724. <value name="EXPECTED">
  725. <block type="unittest_adjustindex">
  726. <value name="INDEX">
  727. <block type="math_number">
  728. <field name="NUM">-1</field>
  729. </block>
  730. </value>
  731. </block>
  732. </value>
  733. </block>
  734. </next>
  735. </block>
  736. </next>
  737. </block>
  738. </next>
  739. </block>
  740. </statement>
  741. </block>
  742. <block type="procedures_defreturn" x="13" y="2838">
  743. <field name="NAME">get fruit</field>
  744. <comment pinned="false" h="80" w="160">Creates a string for use with the find test.</comment>
  745. <statement name="STACK">
  746. <block type="math_change">
  747. <field name="VAR">number of calls</field>
  748. <value name="DELTA">
  749. <block type="math_number">
  750. <field name="NUM">1</field>
  751. </block>
  752. </value>
  753. </block>
  754. </statement>
  755. <value name="RETURN">
  756. <block type="text">
  757. <field name="TEXT">Banana</field>
  758. </block>
  759. </value>
  760. </block>
  761. <block type="procedures_defnoreturn" x="13" y="2938">
  762. <field name="NAME">test find complex</field>
  763. <comment pinned="false" h="80" w="160">Tests the "find" block with a function call.</comment>
  764. <statement name="STACK">
  765. <block type="variables_set">
  766. <field name="VAR">number of calls</field>
  767. <value name="VALUE">
  768. <block type="math_number">
  769. <field name="NUM">0</field>
  770. </block>
  771. </value>
  772. <next>
  773. <block type="unittest_assertequals" inline="false">
  774. <value name="MESSAGE">
  775. <block type="text">
  776. <field name="TEXT">find first complex</field>
  777. </block>
  778. </value>
  779. <value name="ACTUAL">
  780. <block type="text_indexOf">
  781. <field name="END">FIRST</field>
  782. <value name="VALUE">
  783. <block type="procedures_callreturn">
  784. <mutation name="get fruit"></mutation>
  785. </block>
  786. </value>
  787. <value name="FIND">
  788. <block type="text">
  789. <field name="TEXT">an</field>
  790. </block>
  791. </value>
  792. </block>
  793. </value>
  794. <value name="EXPECTED">
  795. <block type="unittest_adjustindex">
  796. <value name="INDEX">
  797. <block type="math_number">
  798. <field name="NUM">1</field>
  799. </block>
  800. </value>
  801. </block>
  802. </value>
  803. <next>
  804. <block type="procedures_callnoreturn" inline="true">
  805. <mutation name="check number of calls">
  806. <arg name="test name"></arg>
  807. </mutation>
  808. <value name="ARG0">
  809. <block type="text">
  810. <field name="TEXT">find first complex</field>
  811. </block>
  812. </value>
  813. <next>
  814. <block type="variables_set">
  815. <field name="VAR">number of calls</field>
  816. <value name="VALUE">
  817. <block type="math_number">
  818. <field name="NUM">0</field>
  819. </block>
  820. </value>
  821. <next>
  822. <block type="unittest_assertequals" inline="false">
  823. <value name="MESSAGE">
  824. <block type="text">
  825. <field name="TEXT">find first order complex</field>
  826. </block>
  827. </value>
  828. <value name="ACTUAL">
  829. <block type="text_indexOf">
  830. <field name="END">FIRST</field>
  831. <value name="VALUE">
  832. <block type="logic_ternary" inline="true">
  833. <value name="IF">
  834. <block type="logic_boolean">
  835. <field name="BOOL">TRUE</field>
  836. </block>
  837. </value>
  838. <value name="THEN">
  839. <block type="procedures_callreturn">
  840. <mutation name="get fruit"></mutation>
  841. </block>
  842. </value>
  843. <value name="ELSE">
  844. <block type="logic_null"></block>
  845. </value>
  846. </block>
  847. </value>
  848. <value name="FIND">
  849. <block type="text">
  850. <field name="TEXT">an</field>
  851. </block>
  852. </value>
  853. </block>
  854. </value>
  855. <value name="EXPECTED">
  856. <block type="unittest_adjustindex">
  857. <value name="INDEX">
  858. <block type="math_number">
  859. <field name="NUM">1</field>
  860. </block>
  861. </value>
  862. </block>
  863. </value>
  864. <next>
  865. <block type="procedures_callnoreturn" inline="true">
  866. <mutation name="check number of calls">
  867. <arg name="test name"></arg>
  868. </mutation>
  869. <value name="ARG0">
  870. <block type="text">
  871. <field name="TEXT">find first order complex</field>
  872. </block>
  873. </value>
  874. <next>
  875. <block type="variables_set">
  876. <field name="VAR">number of calls</field>
  877. <value name="VALUE">
  878. <block type="math_number">
  879. <field name="NUM">0</field>
  880. </block>
  881. </value>
  882. <next>
  883. <block type="unittest_assertequals" inline="false">
  884. <value name="MESSAGE">
  885. <block type="text">
  886. <field name="TEXT">find last complex</field>
  887. </block>
  888. </value>
  889. <value name="ACTUAL">
  890. <block type="text_indexOf">
  891. <field name="END">LAST</field>
  892. <value name="VALUE">
  893. <block type="procedures_callreturn">
  894. <mutation name="get fruit"></mutation>
  895. </block>
  896. </value>
  897. <value name="FIND">
  898. <block type="text">
  899. <field name="TEXT">an</field>
  900. </block>
  901. </value>
  902. </block>
  903. </value>
  904. <value name="EXPECTED">
  905. <block type="unittest_adjustindex">
  906. <value name="INDEX">
  907. <block type="math_number">
  908. <field name="NUM">3</field>
  909. </block>
  910. </value>
  911. </block>
  912. </value>
  913. <next>
  914. <block type="procedures_callnoreturn" inline="true">
  915. <mutation name="check number of calls">
  916. <arg name="test name"></arg>
  917. </mutation>
  918. <value name="ARG0">
  919. <block type="text">
  920. <field name="TEXT">find last complex</field>
  921. </block>
  922. </value>
  923. <next>
  924. <block type="variables_set">
  925. <field name="VAR">number of calls</field>
  926. <value name="VALUE">
  927. <block type="math_number">
  928. <field name="NUM">0</field>
  929. </block>
  930. </value>
  931. <next>
  932. <block type="unittest_assertequals" inline="false">
  933. <value name="MESSAGE">
  934. <block type="text">
  935. <field name="TEXT">find last order complex</field>
  936. </block>
  937. </value>
  938. <value name="ACTUAL">
  939. <block type="text_indexOf">
  940. <field name="END">LAST</field>
  941. <value name="VALUE">
  942. <block type="logic_ternary" inline="true">
  943. <value name="IF">
  944. <block type="logic_boolean">
  945. <field name="BOOL">TRUE</field>
  946. </block>
  947. </value>
  948. <value name="THEN">
  949. <block type="procedures_callreturn">
  950. <mutation name="get fruit"></mutation>
  951. </block>
  952. </value>
  953. <value name="ELSE">
  954. <block type="logic_null"></block>
  955. </value>
  956. </block>
  957. </value>
  958. <value name="FIND">
  959. <block type="text">
  960. <field name="TEXT">an</field>
  961. </block>
  962. </value>
  963. </block>
  964. </value>
  965. <value name="EXPECTED">
  966. <block type="unittest_adjustindex">
  967. <value name="INDEX">
  968. <block type="math_number">
  969. <field name="NUM">3</field>
  970. </block>
  971. </value>
  972. </block>
  973. </value>
  974. <next>
  975. <block type="procedures_callnoreturn" inline="true">
  976. <mutation name="check number of calls">
  977. <arg name="test name"></arg>
  978. </mutation>
  979. <value name="ARG0">
  980. <block type="text">
  981. <field name="TEXT">find last order complex</field>
  982. </block>
  983. </value>
  984. <next>
  985. <block type="variables_set">
  986. <field name="VAR">number of calls</field>
  987. <value name="VALUE">
  988. <block type="math_number">
  989. <field name="NUM">0</field>
  990. </block>
  991. </value>
  992. <next>
  993. <block type="unittest_assertequals" inline="false">
  994. <value name="MESSAGE">
  995. <block type="text">
  996. <field name="TEXT">find none complex</field>
  997. </block>
  998. </value>
  999. <value name="ACTUAL">
  1000. <block type="text_indexOf">
  1001. <field name="END">FIRST</field>
  1002. <value name="VALUE">
  1003. <block type="procedures_callreturn">
  1004. <mutation name="get fruit"></mutation>
  1005. </block>
  1006. </value>
  1007. <value name="FIND">
  1008. <block type="text">
  1009. <field name="TEXT">Peel</field>
  1010. </block>
  1011. </value>
  1012. </block>
  1013. </value>
  1014. <value name="EXPECTED">
  1015. <block type="unittest_adjustindex">
  1016. <value name="INDEX">
  1017. <block type="math_number">
  1018. <field name="NUM">-1</field>
  1019. </block>
  1020. </value>
  1021. </block>
  1022. </value>
  1023. <next>
  1024. <block type="procedures_callnoreturn" inline="true">
  1025. <mutation name="check number of calls">
  1026. <arg name="test name"></arg>
  1027. </mutation>
  1028. <value name="ARG0">
  1029. <block type="text">
  1030. <field name="TEXT">find none complex</field>
  1031. </block>
  1032. </value>
  1033. <next>
  1034. <block type="variables_set">
  1035. <field name="VAR">number of calls</field>
  1036. <value name="VALUE">
  1037. <block type="math_number">
  1038. <field name="NUM">0</field>
  1039. </block>
  1040. </value>
  1041. <next>
  1042. <block type="unittest_assertequals" inline="false">
  1043. <value name="MESSAGE">
  1044. <block type="text">
  1045. <field name="TEXT">find none order complex</field>
  1046. </block>
  1047. </value>
  1048. <value name="ACTUAL">
  1049. <block type="text_indexOf">
  1050. <field name="END">FIRST</field>
  1051. <value name="VALUE">
  1052. <block type="logic_ternary" inline="true">
  1053. <value name="IF">
  1054. <block type="logic_boolean">
  1055. <field name="BOOL">TRUE</field>
  1056. </block>
  1057. </value>
  1058. <value name="THEN">
  1059. <block type="procedures_callreturn">
  1060. <mutation name="get fruit"></mutation>
  1061. </block>
  1062. </value>
  1063. <value name="ELSE">
  1064. <block type="logic_null"></block>
  1065. </value>
  1066. </block>
  1067. </value>
  1068. <value name="FIND">
  1069. <block type="text">
  1070. <field name="TEXT">Peel</field>
  1071. </block>
  1072. </value>
  1073. </block>
  1074. </value>
  1075. <value name="EXPECTED">
  1076. <block type="unittest_adjustindex">
  1077. <value name="INDEX">
  1078. <block type="math_number">
  1079. <field name="NUM">-1</field>
  1080. </block>
  1081. </value>
  1082. </block>
  1083. </value>
  1084. <next>
  1085. <block type="procedures_callnoreturn" inline="true">
  1086. <mutation name="check number of calls">
  1087. <arg name="test name"></arg>
  1088. </mutation>
  1089. <value name="ARG0">
  1090. <block type="text">
  1091. <field name="TEXT">find none order complex</field>
  1092. </block>
  1093. </value>
  1094. </block>
  1095. </next>
  1096. </block>
  1097. </next>
  1098. </block>
  1099. </next>
  1100. </block>
  1101. </next>
  1102. </block>
  1103. </next>
  1104. </block>
  1105. </next>
  1106. </block>
  1107. </next>
  1108. </block>
  1109. </next>
  1110. </block>
  1111. </next>
  1112. </block>
  1113. </next>
  1114. </block>
  1115. </next>
  1116. </block>
  1117. </next>
  1118. </block>
  1119. </next>
  1120. </block>
  1121. </next>
  1122. </block>
  1123. </next>
  1124. </block>
  1125. </next>
  1126. </block>
  1127. </next>
  1128. </block>
  1129. </statement>
  1130. </block>
  1131. <block type="procedures_defnoreturn" x="13" y="4013">
  1132. <field name="NAME">test get simple</field>
  1133. <comment pinned="false" h="80" w="160">Tests the "get letter" block with a variable.</comment>
  1134. <statement name="STACK">
  1135. <block type="variables_set" inline="false">
  1136. <field name="VAR">text</field>
  1137. <value name="VALUE">
  1138. <block type="text">
  1139. <field name="TEXT">Blockly</field>
  1140. </block>
  1141. </value>
  1142. <next>
  1143. <block type="unittest_assertequals" inline="false">
  1144. <value name="MESSAGE">
  1145. <block type="text">
  1146. <field name="TEXT">get first simple</field>
  1147. </block>
  1148. </value>
  1149. <value name="ACTUAL">
  1150. <block type="text_charAt">
  1151. <mutation at="false"></mutation>
  1152. <field name="WHERE">FIRST</field>
  1153. <value name="VALUE">
  1154. <block type="variables_get">
  1155. <field name="VAR">text</field>
  1156. </block>
  1157. </value>
  1158. </block>
  1159. </value>
  1160. <value name="EXPECTED">
  1161. <block type="text">
  1162. <field name="TEXT">B</field>
  1163. </block>
  1164. </value>
  1165. <next>
  1166. <block type="unittest_assertequals" inline="false">
  1167. <value name="MESSAGE">
  1168. <block type="text">
  1169. <field name="TEXT">get last simple</field>
  1170. </block>
  1171. </value>
  1172. <value name="ACTUAL">
  1173. <block type="text_charAt">
  1174. <mutation at="false"></mutation>
  1175. <field name="WHERE">LAST</field>
  1176. <value name="VALUE">
  1177. <block type="variables_get">
  1178. <field name="VAR">text</field>
  1179. </block>
  1180. </value>
  1181. </block>
  1182. </value>
  1183. <value name="EXPECTED">
  1184. <block type="text">
  1185. <field name="TEXT">y</field>
  1186. </block>
  1187. </value>
  1188. <next>
  1189. <block type="unittest_assertvalue" inline="false">
  1190. <field name="EXPECTED">TRUE</field>
  1191. <value name="MESSAGE">
  1192. <block type="text">
  1193. <field name="TEXT">get random simple</field>
  1194. </block>
  1195. </value>
  1196. <value name="ACTUAL">
  1197. <block type="logic_compare">
  1198. <field name="OP">GT</field>
  1199. <value name="A">
  1200. <block type="text_indexOf" inline="false">
  1201. <field name="END">FIRST</field>
  1202. <value name="VALUE">
  1203. <block type="variables_get">
  1204. <field name="VAR">text</field>
  1205. </block>
  1206. </value>
  1207. <value name="FIND">
  1208. <block type="text_charAt">
  1209. <mutation at="false"></mutation>
  1210. <field name="WHERE">RANDOM</field>
  1211. <value name="VALUE">
  1212. <block type="variables_get">
  1213. <field name="VAR">text</field>
  1214. </block>
  1215. </value>
  1216. </block>
  1217. </value>
  1218. </block>
  1219. </value>
  1220. <value name="B">
  1221. <block type="unittest_adjustindex">
  1222. <value name="INDEX">
  1223. <block type="math_number">
  1224. <field name="NUM">-1</field>
  1225. </block>
  1226. </value>
  1227. </block>
  1228. </value>
  1229. </block>
  1230. </value>
  1231. <next>
  1232. <block type="unittest_assertequals" inline="false">
  1233. <value name="MESSAGE">
  1234. <block type="text">
  1235. <field name="TEXT">get # simple</field>
  1236. </block>
  1237. </value>
  1238. <value name="ACTUAL">
  1239. <block type="text_charAt">
  1240. <mutation at="true"></mutation>
  1241. <field name="WHERE">FROM_START</field>
  1242. <value name="VALUE">
  1243. <block type="variables_get">
  1244. <field name="VAR">text</field>
  1245. </block>
  1246. </value>
  1247. <value name="AT">
  1248. <block type="unittest_adjustindex">
  1249. <value name="INDEX">
  1250. <block type="math_number">
  1251. <field name="NUM">2</field>
  1252. </block>
  1253. </value>
  1254. </block>
  1255. </value>
  1256. </block>
  1257. </value>
  1258. <value name="EXPECTED">
  1259. <block type="text">
  1260. <field name="TEXT">o</field>
  1261. </block>
  1262. </value>
  1263. <next>
  1264. <block type="unittest_assertequals" inline="false">
  1265. <value name="MESSAGE">
  1266. <block type="text">
  1267. <field name="TEXT">get # order simple</field>
  1268. </block>
  1269. </value>
  1270. <value name="ACTUAL">
  1271. <block type="text_charAt">
  1272. <mutation at="true"></mutation>
  1273. <field name="WHERE">FROM_START</field>
  1274. <value name="VALUE">
  1275. <block type="variables_get">
  1276. <field name="VAR">text</field>
  1277. </block>
  1278. </value>
  1279. <value name="AT">
  1280. <block type="logic_ternary">
  1281. <value name="IF">
  1282. <block type="logic_boolean">
  1283. <field name="BOOL">TRUE</field>
  1284. </block>
  1285. </value>
  1286. <value name="THEN">
  1287. <block type="unittest_adjustindex">
  1288. <value name="INDEX">
  1289. <block type="math_number">
  1290. <field name="NUM">2</field>
  1291. </block>
  1292. </value>
  1293. </block>
  1294. </value>
  1295. <value name="ELSE">
  1296. <block type="logic_null"></block>
  1297. </value>
  1298. </block>
  1299. </value>
  1300. </block>
  1301. </value>
  1302. <value name="EXPECTED">
  1303. <block type="text">
  1304. <field name="TEXT">o</field>
  1305. </block>
  1306. </value>
  1307. <next>
  1308. <block type="unittest_assertequals" inline="false">
  1309. <value name="MESSAGE">
  1310. <block type="text">
  1311. <field name="TEXT">get #-end simple</field>
  1312. </block>
  1313. </value>
  1314. <value name="ACTUAL">
  1315. <block type="text_charAt">
  1316. <mutation at="true"></mutation>
  1317. <field name="WHERE">FROM_END</field>
  1318. <value name="VALUE">
  1319. <block type="variables_get">
  1320. <field name="VAR">text</field>
  1321. </block>
  1322. </value>
  1323. <value name="AT">
  1324. <block type="unittest_adjustindex">
  1325. <value name="INDEX">
  1326. <block type="math_number">
  1327. <field name="NUM">2</field>
  1328. </block>
  1329. </value>
  1330. </block>
  1331. </value>
  1332. </block>
  1333. </value>
  1334. <value name="EXPECTED">
  1335. <block type="text">
  1336. <field name="TEXT">k</field>
  1337. </block>
  1338. </value>
  1339. <next>
  1340. <block type="unittest_assertequals" inline="false">
  1341. <value name="MESSAGE">
  1342. <block type="text">
  1343. <field name="TEXT">get #-end order simple</field>
  1344. </block>
  1345. </value>
  1346. <value name="ACTUAL">
  1347. <block type="text_charAt">
  1348. <mutation at="true"></mutation>
  1349. <field name="WHERE">FROM_END</field>
  1350. <comment pinned="false" h="84" w="274">The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index.</comment>
  1351. <value name="VALUE">
  1352. <block type="variables_get">
  1353. <field name="VAR">text</field>
  1354. </block>
  1355. </value>
  1356. <value name="AT">
  1357. <block type="math_arithmetic">
  1358. <field name="OP">ADD</field>
  1359. <value name="A">
  1360. <block type="math_number">
  1361. <field name="NUM">0</field>
  1362. </block>
  1363. </value>
  1364. <value name="B">
  1365. <block type="unittest_adjustindex">
  1366. <value name="INDEX">
  1367. <block type="math_number">
  1368. <field name="NUM">2</field>
  1369. </block>
  1370. </value>
  1371. </block>
  1372. </value>
  1373. </block>
  1374. </value>
  1375. </block>
  1376. </value>
  1377. <value name="EXPECTED">
  1378. <block type="text">
  1379. <field name="TEXT">k</field>
  1380. </block>
  1381. </value>
  1382. </block>
  1383. </next>
  1384. </block>
  1385. </next>
  1386. </block>
  1387. </next>
  1388. </block>
  1389. </next>
  1390. </block>
  1391. </next>
  1392. </block>
  1393. </next>
  1394. </block>
  1395. </next>
  1396. </block>
  1397. </statement>
  1398. </block>
  1399. <block type="procedures_defreturn" x="13" y="4838">
  1400. <field name="NAME">get Blockly</field>
  1401. <comment pinned="false" h="80" w="160">Creates a string for use with the get test.</comment>
  1402. <statement name="STACK">
  1403. <block type="math_change">
  1404. <field name="VAR">number of calls</field>
  1405. <value name="DELTA">
  1406. <block type="math_number">
  1407. <field name="NUM">1</field>
  1408. </block>
  1409. </value>
  1410. </block>
  1411. </statement>
  1412. <value name="RETURN">
  1413. <block type="text">
  1414. <field name="TEXT">Blockly</field>
  1415. </block>
  1416. </value>
  1417. </block>
  1418. <block type="procedures_defnoreturn" x="13" y="4938">
  1419. <field name="NAME">test get complex</field>
  1420. <comment pinned="false" h="80" w="160">Tests the "get letter" block with a function call.</comment>
  1421. <statement name="STACK">
  1422. <block type="variables_set" inline="false">
  1423. <field name="VAR">text</field>
  1424. <value name="VALUE">
  1425. <block type="text">
  1426. <field name="TEXT">Blockly</field>
  1427. </block>
  1428. </value>
  1429. <next>
  1430. <block type="variables_set">
  1431. <field name="VAR">number of calls</field>
  1432. <value name="VALUE">
  1433. <block type="math_number">
  1434. <field name="NUM">0</field>
  1435. </block>
  1436. </value>
  1437. <next>
  1438. <block type="unittest_assertequals" inline="false">
  1439. <value name="MESSAGE">
  1440. <block type="text">
  1441. <field name="TEXT">get first complex</field>
  1442. </block>
  1443. </value>
  1444. <value name="ACTUAL">
  1445. <block type="text_charAt">
  1446. <mutation at="false"></mutation>
  1447. <field name="WHERE">FIRST</field>
  1448. <value name="VALUE">
  1449. <block type="procedures_callreturn">
  1450. <mutation name="get Blockly"></mutation>
  1451. </block>
  1452. </value>
  1453. </block>
  1454. </value>
  1455. <value name="EXPECTED">
  1456. <block type="text">
  1457. <field name="TEXT">B</field>
  1458. </block>
  1459. </value>
  1460. <next>
  1461. <block type="procedures_callnoreturn" inline="true">
  1462. <mutation name="check number of calls">
  1463. <arg name="test name"></arg>
  1464. </mutation>
  1465. <value name="ARG0">
  1466. <block type="text">
  1467. <field name="TEXT">get first complex</field>
  1468. </block>
  1469. </value>
  1470. <next>
  1471. <block type="variables_set">
  1472. <field name="VAR">number of calls</field>
  1473. <value name="VALUE">
  1474. <block type="math_number">
  1475. <field name="NUM">0</field>
  1476. </block>
  1477. </value>
  1478. <next>
  1479. <block type="unittest_assertequals" inline="false">
  1480. <value name="MESSAGE">
  1481. <block type="text">
  1482. <field name="TEXT">get first order complex</field>
  1483. </block>
  1484. </value>
  1485. <value name="ACTUAL">
  1486. <block type="text_charAt">
  1487. <mutation at="false"></mutation>
  1488. <field name="WHERE">FIRST</field>
  1489. <value name="VALUE">
  1490. <block type="logic_ternary" inline="true">
  1491. <value name="IF">
  1492. <block type="logic_boolean">
  1493. <field name="BOOL">TRUE</field>
  1494. </block>
  1495. </value>
  1496. <value name="THEN">
  1497. <block type="procedures_callreturn">
  1498. <mutation name="get Blockly"></mutation>
  1499. </block>
  1500. </value>
  1501. <value name="ELSE">
  1502. <block type="logic_null"></block>
  1503. </value>
  1504. </block>
  1505. </value>
  1506. </block>
  1507. </value>
  1508. <value name="EXPECTED">
  1509. <block type="text">
  1510. <field name="TEXT">B</field>
  1511. </block>
  1512. </value>
  1513. <next>
  1514. <block type="procedures_callnoreturn" inline="true">
  1515. <mutation name="check number of calls">
  1516. <arg name="test name"></arg>
  1517. </mutation>
  1518. <value name="ARG0">
  1519. <block type="text">
  1520. <field name="TEXT">get first order complex</field>
  1521. </block>
  1522. </value>
  1523. <next>
  1524. <block type="variables_set">
  1525. <field name="VAR">number of calls</field>
  1526. <value name="VALUE">
  1527. <block type="math_number">
  1528. <field name="NUM">0</field>
  1529. </block>
  1530. </value>
  1531. <next>
  1532. <block type="unittest_assertequals" inline="false">
  1533. <value name="MESSAGE">
  1534. <block type="text">
  1535. <field name="TEXT">get last complex</field>
  1536. </block>
  1537. </value>
  1538. <value name="ACTUAL">
  1539. <block type="text_charAt">
  1540. <mutation at="false"></mutation>
  1541. <field name="WHERE">LAST</field>
  1542. <value name="VALUE">
  1543. <block type="procedures_callreturn">
  1544. <mutation name="get Blockly"></mutation>
  1545. </block>
  1546. </value>
  1547. </block>
  1548. </value>
  1549. <value name="EXPECTED">
  1550. <block type="text">
  1551. <field name="TEXT">y</field>
  1552. </block>
  1553. </value>
  1554. <next>
  1555. <block type="procedures_callnoreturn" inline="true">
  1556. <mutation name="check number of calls">
  1557. <arg name="test name"></arg>
  1558. </mutation>
  1559. <value name="ARG0">
  1560. <block type="text">
  1561. <field name="TEXT">get last complex</field>
  1562. </block>
  1563. </value>
  1564. <next>
  1565. <block type="variables_set">
  1566. <field name="VAR">number of calls</field>
  1567. <value name="VALUE">
  1568. <block type="math_number">
  1569. <field name="NUM">0</field>
  1570. </block>
  1571. </value>
  1572. <next>
  1573. <block type="unittest_assertequals" inline="false">
  1574. <value name="MESSAGE">
  1575. <block type="text">
  1576. <field name="TEXT">get last order complex</field>
  1577. </block>
  1578. </value>
  1579. <value name="ACTUAL">
  1580. <block type="text_charAt">
  1581. <mutation at="false"></mutation>
  1582. <field name="WHERE">LAST</field>
  1583. <value name="VALUE">
  1584. <block type="logic_ternary" inline="true">
  1585. <value name="IF">
  1586. <block type="logic_boolean">
  1587. <field name="BOOL">TRUE</field>
  1588. </block>
  1589. </value>
  1590. <value name="THEN">
  1591. <block type="procedures_callreturn">
  1592. <mutation name="get Blockly"></mutation>
  1593. </block>
  1594. </value>
  1595. <value name="ELSE">
  1596. <block type="logic_null"></block>
  1597. </value>
  1598. </block>
  1599. </value>
  1600. </block>
  1601. </value>
  1602. <value name="EXPECTED">
  1603. <block type="text">
  1604. <field name="TEXT">y</field>
  1605. </block>
  1606. </value>
  1607. <next>
  1608. <block type="procedures_callnoreturn" inline="true">
  1609. <mutation name="check number of calls">
  1610. <arg name="test name"></arg>
  1611. </mutation>
  1612. <value name="ARG0">
  1613. <block type="text">
  1614. <field name="TEXT">get last order complex</field>
  1615. </block>
  1616. </value>
  1617. <next>
  1618. <block type="variables_set">
  1619. <field name="VAR">number of calls</field>
  1620. <value name="VALUE">
  1621. <block type="math_number">
  1622. <field name="NUM">0</field>
  1623. </block>
  1624. </value>
  1625. <next>
  1626. <block type="unittest_assertvalue" inline="false">
  1627. <field name="EXPECTED">TRUE</field>
  1628. <value name="MESSAGE">
  1629. <block type="text">
  1630. <field name="TEXT">get random complex</field>
  1631. </block>
  1632. </value>
  1633. <value name="ACTUAL">
  1634. <block type="logic_compare">
  1635. <field name="OP">GT</field>
  1636. <value name="A">
  1637. <block type="text_indexOf" inline="false">
  1638. <field name="END">FIRST</field>
  1639. <value name="VALUE">
  1640. <block type="variables_get">
  1641. <field name="VAR">text</field>
  1642. </block>
  1643. </value>
  1644. <value name="FIND">
  1645. <block type="text_charAt">
  1646. <mutation at="false"></mutation>
  1647. <field name="WHERE">RANDOM</field>
  1648. <value name="VALUE">
  1649. <block type="procedures_callreturn">
  1650. <mutation name="get Blockly"></mutation>
  1651. </block>
  1652. </value>
  1653. </block>
  1654. </value>
  1655. </block>
  1656. </value>
  1657. <value name="B">
  1658. <block type="unittest_adjustindex">
  1659. <value name="INDEX">
  1660. <block type="math_number">
  1661. <field name="NUM">-1</field>
  1662. </block>
  1663. </value>
  1664. </block>
  1665. </value>
  1666. </block>
  1667. </value>
  1668. <next>
  1669. <block type="procedures_callnoreturn" inline="true">
  1670. <mutation name="check number of calls">
  1671. <arg name="test name"></arg>
  1672. </mutation>
  1673. <value name="ARG0">
  1674. <block type="text">
  1675. <field name="TEXT">get random complex</field>
  1676. </block>
  1677. </value>
  1678. <next>
  1679. <block type="variables_set">
  1680. <field name="VAR">number of calls</field>
  1681. <value name="VALUE">
  1682. <block type="math_number">
  1683. <field name="NUM">0</field>
  1684. </block>
  1685. </value>
  1686. <next>
  1687. <block type="unittest_assertvalue" inline="false">
  1688. <field name="EXPECTED">TRUE</field>
  1689. <value name="MESSAGE">
  1690. <block type="text">
  1691. <field name="TEXT">get random order complex</field>
  1692. </block>
  1693. </value>
  1694. <value name="ACTUAL">
  1695. <block type="logic_compare">
  1696. <field name="OP">GT</field>
  1697. <value name="A">
  1698. <block type="text_indexOf" inline="false">
  1699. <field name="END">FIRST</field>
  1700. <value name="VALUE">
  1701. <block type="variables_get">
  1702. <field name="VAR">text</field>
  1703. </block>
  1704. </value>
  1705. <value name="FIND">
  1706. <block type="text_charAt">
  1707. <mutation at="false"></mutation>
  1708. <field name="WHERE">RANDOM</field>
  1709. <value name="VALUE">
  1710. <block type="logic_ternary" inline="false">
  1711. <value name="IF">
  1712. <block type="logic_boolean">
  1713. <field name="BOOL">TRUE</field>
  1714. </block>
  1715. </value>
  1716. <value name="THEN">
  1717. <block type="procedures_callreturn">
  1718. <mutation name="get Blockly"></mutation>
  1719. </block>
  1720. </value>
  1721. <value name="ELSE">
  1722. <block type="logic_null"></block>
  1723. </value>
  1724. </block>
  1725. </value>
  1726. </block>
  1727. </value>
  1728. </block>
  1729. </value>
  1730. <value name="B">
  1731. <block type="unittest_adjustindex">
  1732. <value name="INDEX">
  1733. <block type="math_number">
  1734. <field name="NUM">-1</field>
  1735. </block>
  1736. </value>
  1737. </block>
  1738. </value>
  1739. </block>
  1740. </value>
  1741. <next>
  1742. <block type="procedures_callnoreturn" inline="true">
  1743. <mutation name="check number of calls">
  1744. <arg name="test name"></arg>
  1745. </mutation>
  1746. <value name="ARG0">
  1747. <block type="text">
  1748. <field name="TEXT">get random order complex</field>
  1749. </block>
  1750. </value>
  1751. <next>
  1752. <block type="variables_set">
  1753. <field name="VAR">number of calls</field>
  1754. <value name="VALUE">
  1755. <block type="math_number">
  1756. <field name="NUM">0</field>
  1757. </block>
  1758. </value>
  1759. <next>
  1760. <block type="unittest_assertequals" inline="false">
  1761. <value name="MESSAGE">
  1762. <block type="text">
  1763. <field name="TEXT">get # complex</field>
  1764. </block>
  1765. </value>
  1766. <value name="ACTUAL">
  1767. <block type="text_charAt">
  1768. <mutation at="true"></mutation>
  1769. <field name="WHERE">FROM_START</field>
  1770. <value name="VALUE">
  1771. <block type="procedures_callreturn">
  1772. <mutation name="get Blockly"></mutation>
  1773. </block>
  1774. </value>
  1775. <value name="AT">
  1776. <block type="unittest_adjustindex">
  1777. <value name="INDEX">
  1778. <block type="math_number">
  1779. <field name="NUM">2</field>
  1780. </block>
  1781. </value>
  1782. </block>
  1783. </value>
  1784. </block>
  1785. </value>
  1786. <value name="EXPECTED">
  1787. <block type="text">
  1788. <field name="TEXT">o</field>
  1789. </block>
  1790. </value>
  1791. <next>
  1792. <block type="procedures_callnoreturn" inline="true">
  1793. <mutation name="check number of calls">
  1794. <arg name="test name"></arg>
  1795. </mutation>
  1796. <value name="ARG0">
  1797. <block type="text">
  1798. <field name="TEXT">get # complex</field>
  1799. </block>
  1800. </value>
  1801. <next>
  1802. <block type="variables_set">
  1803. <field name="VAR">number of calls</field>
  1804. <value name="VALUE">
  1805. <block type="math_number">
  1806. <field name="NUM">0</field>
  1807. </block>
  1808. </value>
  1809. <next>
  1810. <block type="unittest_assertequals" inline="false">
  1811. <value name="MESSAGE">
  1812. <block type="text">
  1813. <field name="TEXT">get # order complex</field>
  1814. </block>
  1815. </value>
  1816. <value name="ACTUAL">
  1817. <block type="text_charAt">
  1818. <mutation at="true"></mutation>
  1819. <field name="WHERE">FROM_START</field>
  1820. <value name="VALUE">
  1821. <block type="logic_ternary" inline="false">
  1822. <value name="IF">
  1823. <block type="logic_boolean">
  1824. <field name="BOOL">TRUE</field>
  1825. </block>
  1826. </value>
  1827. <value name="THEN">
  1828. <block type="procedures_callreturn">
  1829. <mutation name="get Blockly"></mutation>
  1830. </block>
  1831. </value>
  1832. <value name="ELSE">
  1833. <block type="logic_null"></block>
  1834. </value>
  1835. </block>
  1836. </value>
  1837. <value name="AT">
  1838. <block type="logic_ternary">
  1839. <value name="IF">
  1840. <block type="logic_boolean">
  1841. <field name="BOOL">TRUE</field>
  1842. </block>
  1843. </value>
  1844. <value name="THEN">
  1845. <block type="unittest_adjustindex">
  1846. <value name="INDEX">
  1847. <block type="math_number">
  1848. <field name="NUM">2</field>
  1849. </block>
  1850. </value>
  1851. </block>
  1852. </value>
  1853. <value name="ELSE">
  1854. <block type="logic_null"></block>
  1855. </value>
  1856. </block>
  1857. </value>
  1858. </block>
  1859. </value>
  1860. <value name="EXPECTED">
  1861. <block type="text">
  1862. <field name="TEXT">o</field>
  1863. </block>
  1864. </value>
  1865. <next>
  1866. <block type="procedures_callnoreturn" inline="true">
  1867. <mutation name="check number of calls">
  1868. <arg name="test name"></arg>
  1869. </mutation>
  1870. <value name="ARG0">
  1871. <block type="text">
  1872. <field name="TEXT">get # order complex</field>
  1873. </block>
  1874. </value>
  1875. <next>
  1876. <block type="variables_set">
  1877. <field name="VAR">number of calls</field>
  1878. <value name="VALUE">
  1879. <block type="math_number">
  1880. <field name="NUM">0</field>
  1881. </block>
  1882. </value>
  1883. <next>
  1884. <block type="unittest_assertequals" inline="false">
  1885. <value name="MESSAGE">
  1886. <block type="text">
  1887. <field name="TEXT">get #-end complex</field>
  1888. </block>
  1889. </value>
  1890. <value name="ACTUAL">
  1891. <block type="text_charAt">
  1892. <mutation at="true"></mutation>
  1893. <field name="WHERE">FROM_END</field>
  1894. <value name="VALUE">
  1895. <block type="procedures_callreturn">
  1896. <mutation name="get Blockly"></mutation>
  1897. </block>
  1898. </value>
  1899. <value name="AT">
  1900. <block type="unittest_adjustindex">
  1901. <value name="INDEX">
  1902. <block type="math_number">
  1903. <field name="NUM">2</field>
  1904. </block>
  1905. </value>
  1906. </block>
  1907. </value>
  1908. </block>
  1909. </value>
  1910. <value name="EXPECTED">
  1911. <block type="text">
  1912. <field name="TEXT">k</field>
  1913. </block>
  1914. </value>
  1915. <next>
  1916. <block type="procedures_callnoreturn" inline="true">
  1917. <mutation name="check number of calls">
  1918. <arg name="test name"></arg>
  1919. </mutation>
  1920. <value name="ARG0">
  1921. <block type="text">
  1922. <field name="TEXT">get #-end complex</field>
  1923. </block>
  1924. </value>
  1925. <next>
  1926. <block type="variables_set">
  1927. <field name="VAR">number of calls</field>
  1928. <value name="VALUE">
  1929. <block type="math_number">
  1930. <field name="NUM">0</field>
  1931. </block>
  1932. </value>
  1933. <next>
  1934. <block type="unittest_assertequals" inline="false">
  1935. <value name="MESSAGE">
  1936. <block type="text">
  1937. <field name="TEXT">get #-end order complex</field>
  1938. </block>
  1939. </value>
  1940. <value name="ACTUAL">
  1941. <block type="text_charAt">
  1942. <mutation at="true"></mutation>
  1943. <field name="WHERE">FROM_END</field>
  1944. <comment pinned="false" h="83" w="258">The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index.</comment>
  1945. <value name="VALUE">
  1946. <block type="logic_ternary" inline="true">
  1947. <value name="IF">
  1948. <block type="logic_boolean">
  1949. <field name="BOOL">TRUE</field>
  1950. </block>
  1951. </value>
  1952. <value name="THEN">
  1953. <block type="procedures_callreturn">
  1954. <mutation name="get Blockly"></mutation>
  1955. </block>
  1956. </value>
  1957. <value name="ELSE">
  1958. <block type="logic_null"></block>
  1959. </value>
  1960. </block>
  1961. </value>
  1962. <value name="AT">
  1963. <block type="math_arithmetic">
  1964. <field name="OP">ADD</field>
  1965. <value name="A">
  1966. <block type="math_number">
  1967. <field name="NUM">0</field>
  1968. </block>
  1969. </value>
  1970. <value name="B">
  1971. <block type="unittest_adjustindex">
  1972. <value name="INDEX">
  1973. <block type="math_number">
  1974. <field name="NUM">2</field>
  1975. </block>
  1976. </value>
  1977. </block>
  1978. </value>
  1979. </block>
  1980. </value>
  1981. </block>
  1982. </value>
  1983. <value name="EXPECTED">
  1984. <block type="text">
  1985. <field name="TEXT">k</field>
  1986. </block>
  1987. </value>
  1988. <next>
  1989. <block type="procedures_callnoreturn" inline="true">
  1990. <mutation name="check number of calls">
  1991. <arg name="test name"></arg>
  1992. </mutation>
  1993. <value name="ARG0">
  1994. <block type="text">
  1995. <field name="TEXT">get #-end order complex</field>
  1996. </block>
  1997. </value>
  1998. </block>
  1999. </next>
  2000. </block>
  2001. </next>
  2002. </block>
  2003. </next>
  2004. </block>
  2005. </next>
  2006. </block>
  2007. </next>
  2008. </block>
  2009. </next>
  2010. </block>
  2011. </next>
  2012. </block>
  2013. </next>
  2014. </block>
  2015. </next>
  2016. </block>
  2017. </next>
  2018. </block>
  2019. </next>
  2020. </block>
  2021. </next>
  2022. </block>
  2023. </next>
  2024. </block>
  2025. </next>
  2026. </block>
  2027. </next>
  2028. </block>
  2029. </next>
  2030. </block>
  2031. </next>
  2032. </block>
  2033. </next>
  2034. </block>
  2035. </next>
  2036. </block>
  2037. </next>
  2038. </block>
  2039. </next>
  2040. </block>
  2041. </next>
  2042. </block>
  2043. </next>
  2044. </block>
  2045. </next>
  2046. </block>
  2047. </next>
  2048. </block>
  2049. </next>
  2050. </block>
  2051. </next>
  2052. </block>
  2053. </next>
  2054. </block>
  2055. </next>
  2056. </block>
  2057. </next>
  2058. </block>
  2059. </statement>
  2060. </block>
  2061. <block type="procedures_defreturn" x="13" y="6738">
  2062. <field name="NAME">get numbers</field>
  2063. <comment pinned="false" h="80" w="160">Creates a string for use with the substring test.</comment>
  2064. <statement name="STACK">
  2065. <block type="math_change">
  2066. <field name="VAR">number of calls</field>
  2067. <value name="DELTA">
  2068. <block type="math_number">
  2069. <field name="NUM">1</field>
  2070. </block>
  2071. </value>
  2072. </block>
  2073. </statement>
  2074. <value name="RETURN">
  2075. <block type="text">
  2076. <field name="TEXT">123456789</field>
  2077. </block>
  2078. </value>
  2079. </block>
  2080. <block type="procedures_defnoreturn" x="13" y="6838">
  2081. <field name="NAME">test substring simple</field>
  2082. <comment pinned="false" h="80" w="160">Tests the "get substring" block with a variable.</comment>
  2083. <statement name="STACK">
  2084. <block type="variables_set" inline="false">
  2085. <field name="VAR">text</field>
  2086. <value name="VALUE">
  2087. <block type="text">
  2088. <field name="TEXT">123456789</field>
  2089. </block>
  2090. </value>
  2091. <next>
  2092. <block type="unittest_assertequals" inline="false">
  2093. <value name="MESSAGE">
  2094. <block type="text">
  2095. <field name="TEXT">substring # simple</field>
  2096. </block>
  2097. </value>
  2098. <value name="ACTUAL">
  2099. <block type="text_getSubstring">
  2100. <mutation at1="true" at2="true"></mutation>
  2101. <field name="WHERE1">FROM_START</field>
  2102. <field name="WHERE2">FROM_START</field>
  2103. <value name="STRING">
  2104. <block type="variables_get">
  2105. <field name="VAR">text</field>
  2106. </block>
  2107. </value>
  2108. <value name="AT1">
  2109. <block type="unittest_adjustindex">
  2110. <value name="INDEX">
  2111. <block type="math_number">
  2112. <field name="NUM">1</field>
  2113. </block>
  2114. </value>
  2115. </block>
  2116. </value>
  2117. <value name="AT2">
  2118. <block type="unittest_adjustindex">
  2119. <value name="INDEX">
  2120. <block type="math_number">
  2121. <field name="NUM">2</field>
  2122. </block>
  2123. </value>
  2124. </block>
  2125. </value>
  2126. </block>
  2127. </value>
  2128. <value name="EXPECTED">
  2129. <block type="text">
  2130. <field name="TEXT">23</field>
  2131. </block>
  2132. </value>
  2133. <next>
  2134. <block type="unittest_assertequals" inline="false">
  2135. <value name="MESSAGE">
  2136. <block type="text">
  2137. <field name="TEXT">substring # simple order</field>
  2138. </block>
  2139. </value>
  2140. <value name="ACTUAL">
  2141. <block type="text_getSubstring">
  2142. <mutation at1="true" at2="true"></mutation>
  2143. <field name="WHERE1">FROM_START</field>
  2144. <field name="WHERE2">FROM_START</field>
  2145. <value name="STRING">
  2146. <block type="variables_get">
  2147. <field name="VAR">text</field>
  2148. </block>
  2149. </value>
  2150. <value name="AT1">
  2151. <block type="logic_ternary">
  2152. <value name="IF">
  2153. <block type="logic_boolean">
  2154. <field name="BOOL">TRUE</field>
  2155. </block>
  2156. </value>
  2157. <value name="THEN">
  2158. <block type="unittest_adjustindex">
  2159. <value name="INDEX">
  2160. <block type="math_number">
  2161. <field name="NUM">1</field>
  2162. </block>
  2163. </value>
  2164. </block>
  2165. </value>
  2166. <value name="ELSE">
  2167. <block type="logic_null"></block>
  2168. </value>
  2169. </block>
  2170. </value>
  2171. <value name="AT2">
  2172. <block type="logic_ternary">
  2173. <value name="IF">
  2174. <block type="logic_boolean">
  2175. <field name="BOOL">TRUE</field>
  2176. </block>
  2177. </value>
  2178. <value name="THEN">
  2179. <block type="unittest_adjustindex">
  2180. <value name="INDEX">
  2181. <block type="math_number">
  2182. <field name="NUM">2</field>
  2183. </block>
  2184. </value>
  2185. </block>
  2186. </value>
  2187. <value name="ELSE">
  2188. <block type="logic_null"></block>
  2189. </value>
  2190. </block>
  2191. </value>
  2192. </block>
  2193. </value>
  2194. <value name="EXPECTED">
  2195. <block type="text">
  2196. <field name="TEXT">23</field>
  2197. </block>
  2198. </value>
  2199. <next>
  2200. <block type="unittest_assertequals" inline="false">
  2201. <value name="MESSAGE">
  2202. <block type="text">
  2203. <field name="TEXT">substring #-end simple</field>
  2204. </block>
  2205. </value>
  2206. <value name="ACTUAL">
  2207. <block type="text_getSubstring">
  2208. <mutation at1="true" at2="true"></mutation>
  2209. <field name="WHERE1">FROM_END</field>
  2210. <field name="WHERE2">FROM_END</field>
  2211. <value name="STRING">
  2212. <block type="variables_get">
  2213. <field name="VAR">text</field>
  2214. </block>
  2215. </value>
  2216. <value name="AT1">
  2217. <block type="unittest_adjustindex">
  2218. <value name="INDEX">
  2219. <block type="math_number">
  2220. <field name="NUM">2</field>
  2221. </block>
  2222. </value>
  2223. </block>
  2224. </value>
  2225. <value name="AT2">
  2226. <block type="unittest_adjustindex">
  2227. <value name="INDEX">
  2228. <block type="math_number">
  2229. <field name="NUM">1</field>
  2230. </block>
  2231. </value>
  2232. </block>
  2233. </value>
  2234. </block>
  2235. </value>
  2236. <value name="EXPECTED">
  2237. <block type="text">
  2238. <field name="TEXT">78</field>
  2239. </block>
  2240. </value>
  2241. <next>
  2242. <block type="unittest_assertequals" inline="false">
  2243. <value name="MESSAGE">
  2244. <block type="text">
  2245. <field name="TEXT">substring #-end simple order</field>
  2246. </block>
  2247. </value>
  2248. <value name="ACTUAL">
  2249. <block type="text_getSubstring">
  2250. <mutation at1="true" at2="true"></mutation>
  2251. <field name="WHERE1">FROM_END</field>
  2252. <field name="WHERE2">FROM_END</field>
  2253. <comment pinned="false" h="81" w="266">The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index.</comment>
  2254. <value name="STRING">
  2255. <block type="variables_get">
  2256. <field name="VAR">text</field>
  2257. </block>
  2258. </value>
  2259. <value name="AT1">
  2260. <block type="math_arithmetic">
  2261. <field name="OP">ADD</field>
  2262. <value name="A">
  2263. <block type="math_number">
  2264. <field name="NUM">0</field>
  2265. </block>
  2266. </value>
  2267. <value name="B">
  2268. <block type="unittest_adjustindex">
  2269. <value name="INDEX">
  2270. <block type="math_number">
  2271. <field name="NUM">2</field>
  2272. </block>
  2273. </value>
  2274. </block>
  2275. </value>
  2276. </block>
  2277. </value>
  2278. <value name="AT2">
  2279. <block type="math_arithmetic">
  2280. <field name="OP">ADD</field>
  2281. <value name="A">
  2282. <block type="math_number">
  2283. <field name="NUM">0</field>
  2284. </block>
  2285. </value>
  2286. <value name="B">
  2287. <block type="unittest_adjustindex">
  2288. <value name="INDEX">
  2289. <block type="math_number">
  2290. <field name="NUM">1</field>
  2291. </block>
  2292. </value>
  2293. </block>
  2294. </value>
  2295. </block>
  2296. </value>
  2297. </block>
  2298. </value>
  2299. <value name="EXPECTED">
  2300. <block type="text">
  2301. <field name="TEXT">78</field>
  2302. </block>
  2303. </value>
  2304. <next>
  2305. <block type="unittest_assertequals" inline="false">
  2306. <value name="MESSAGE">
  2307. <block type="text">
  2308. <field name="TEXT">substring first-last simple</field>
  2309. </block>
  2310. </value>
  2311. <value name="ACTUAL">
  2312. <block type="text_getSubstring">
  2313. <mutation at1="false" at2="false"></mutation>
  2314. <field name="WHERE1">FIRST</field>
  2315. <field name="WHERE2">LAST</field>
  2316. <value name="STRING">
  2317. <block type="variables_get">
  2318. <field name="VAR">text</field>
  2319. </block>
  2320. </value>
  2321. </block>
  2322. </value>
  2323. <value name="EXPECTED">
  2324. <block type="variables_get">
  2325. <field name="VAR">text</field>
  2326. </block>
  2327. </value>
  2328. <next>
  2329. <block type="unittest_assertequals" inline="false">
  2330. <value name="MESSAGE">
  2331. <block type="text">
  2332. <field name="TEXT">substring # #-end simple</field>
  2333. </block>
  2334. </value>
  2335. <value name="ACTUAL">
  2336. <block type="text_getSubstring">
  2337. <mutation at1="true" at2="true"></mutation>
  2338. <field name="WHERE1">FROM_START</field>
  2339. <field name="WHERE2">FROM_END</field>
  2340. <value name="STRING">
  2341. <block type="variables_get">
  2342. <field name="VAR">text</field>
  2343. </block>
  2344. </value>
  2345. <value name="AT1">
  2346. <block type="unittest_adjustindex">
  2347. <value name="INDEX">
  2348. <block type="math_number">
  2349. <field name="NUM">1</field>
  2350. </block>
  2351. </value>
  2352. </block>
  2353. </value>
  2354. <value name="AT2">
  2355. <block type="unittest_adjustindex">
  2356. <value name="INDEX">
  2357. <block type="math_number">
  2358. <field name="NUM">1</field>
  2359. </block>
  2360. </value>
  2361. </block>
  2362. </value>
  2363. </block>
  2364. </value>
  2365. <value name="EXPECTED">
  2366. <block type="text">
  2367. <field name="TEXT">2345678</field>
  2368. </block>
  2369. </value>
  2370. <next>
  2371. <block type="unittest_assertequals" inline="false">
  2372. <value name="MESSAGE">
  2373. <block type="text">
  2374. <field name="TEXT">substring #-end # simple</field>
  2375. </block>
  2376. </value>
  2377. <value name="ACTUAL">
  2378. <block type="text_getSubstring">
  2379. <mutation at1="true" at2="true"></mutation>
  2380. <field name="WHERE1">FROM_END</field>
  2381. <field name="WHERE2">FROM_START</field>
  2382. <value name="STRING">
  2383. <block type="variables_get">
  2384. <field name="VAR">text</field>
  2385. </block>
  2386. </value>
  2387. <value name="AT1">
  2388. <block type="unittest_adjustindex">
  2389. <value name="INDEX">
  2390. <block type="math_number">
  2391. <field name="NUM">6</field>
  2392. </block>
  2393. </value>
  2394. </block>
  2395. </value>
  2396. <value name="AT2">
  2397. <block type="unittest_adjustindex">
  2398. <value name="INDEX">
  2399. <block type="math_number">
  2400. <field name="NUM">3</field>
  2401. </block>
  2402. </value>
  2403. </block>
  2404. </value>
  2405. </block>
  2406. </value>
  2407. <value name="EXPECTED">
  2408. <block type="text">
  2409. <field name="TEXT">34</field>
  2410. </block>
  2411. </value>
  2412. <next>
  2413. <block type="unittest_assertequals" inline="false">
  2414. <value name="MESSAGE">
  2415. <block type="text">
  2416. <field name="TEXT">substring first # simple</field>
  2417. </block>
  2418. </value>
  2419. <value name="ACTUAL">
  2420. <block type="text_getSubstring">
  2421. <mutation at1="false" at2="true"></mutation>
  2422. <field name="WHERE1">FIRST</field>
  2423. <field name="WHERE2">FROM_START</field>
  2424. <value name="STRING">
  2425. <block type="variables_get">
  2426. <field name="VAR">text</field>
  2427. </block>
  2428. </value>
  2429. <value name="AT2">
  2430. <block type="unittest_adjustindex">
  2431. <value name="INDEX">
  2432. <block type="math_number">
  2433. <field name="NUM">3</field>
  2434. </block>
  2435. </value>
  2436. </block>
  2437. </value>
  2438. </block>
  2439. </value>
  2440. <value name="EXPECTED">
  2441. <block type="text">
  2442. <field name="TEXT">1234</field>
  2443. </block>
  2444. </value>
  2445. <next>
  2446. <block type="unittest_assertequals" inline="false">
  2447. <value name="MESSAGE">
  2448. <block type="text">
  2449. <field name="TEXT">substring first #-end simple</field>
  2450. </block>
  2451. </value>
  2452. <value name="ACTUAL">
  2453. <block type="text_getSubstring">
  2454. <mutation at1="false" at2="true"></mutation>
  2455. <field name="WHERE1">FIRST</field>
  2456. <field name="WHERE2">FROM_END</field>
  2457. <value name="STRING">
  2458. <block type="variables_get">
  2459. <field name="VAR">text</field>
  2460. </block>
  2461. </value>
  2462. <value name="AT2">
  2463. <block type="unittest_adjustindex">
  2464. <value name="INDEX">
  2465. <block type="math_number">
  2466. <field name="NUM">1</field>
  2467. </block>
  2468. </value>
  2469. </block>
  2470. </value>
  2471. </block>
  2472. </value>
  2473. <value name="EXPECTED">
  2474. <block type="text">
  2475. <field name="TEXT">12345678</field>
  2476. </block>
  2477. </value>
  2478. <next>
  2479. <block type="unittest_assertequals" inline="false">
  2480. <value name="MESSAGE">
  2481. <block type="text">
  2482. <field name="TEXT">substring # last simple</field>
  2483. </block>
  2484. </value>
  2485. <value name="ACTUAL">
  2486. <block type="text_getSubstring">
  2487. <mutation at1="true" at2="false"></mutation>
  2488. <field name="WHERE1">FROM_START</field>
  2489. <field name="WHERE2">LAST</field>
  2490. <value name="STRING">
  2491. <block type="variables_get">
  2492. <field name="VAR">text</field>
  2493. </block>
  2494. </value>
  2495. <value name="AT1">
  2496. <block type="unittest_adjustindex">
  2497. <value name="INDEX">
  2498. <block type="math_number">
  2499. <field name="NUM">6</field>
  2500. </block>
  2501. </value>
  2502. </block>
  2503. </value>
  2504. </block>
  2505. </value>
  2506. <value name="EXPECTED">
  2507. <block type="text">
  2508. <field name="TEXT">789</field>
  2509. </block>
  2510. </value>
  2511. <next>
  2512. <block type="unittest_assertequals" inline="false">
  2513. <value name="MESSAGE">
  2514. <block type="text">
  2515. <field name="TEXT">substring #-end last simple</field>
  2516. </block>
  2517. </value>
  2518. <value name="ACTUAL">
  2519. <block type="text_getSubstring">
  2520. <mutation at1="true" at2="false"></mutation>
  2521. <field name="WHERE1">FROM_END</field>
  2522. <field name="WHERE2">LAST</field>
  2523. <value name="STRING">
  2524. <block type="variables_get">
  2525. <field name="VAR">text</field>
  2526. </block>
  2527. </value>
  2528. <value name="AT1">
  2529. <block type="unittest_adjustindex">
  2530. <value name="INDEX">
  2531. <block type="math_number">
  2532. <field name="NUM">2</field>
  2533. </block>
  2534. </value>
  2535. </block>
  2536. </value>
  2537. </block>
  2538. </value>
  2539. <value name="EXPECTED">
  2540. <block type="text">
  2541. <field name="TEXT">789</field>
  2542. </block>
  2543. </value>
  2544. <next>
  2545. <block type="unittest_assertequals" inline="false">
  2546. <value name="MESSAGE">
  2547. <block type="text">
  2548. <field name="TEXT">substring all with # #-end simple</field>
  2549. </block>
  2550. </value>
  2551. <value name="ACTUAL">
  2552. <block type="text_getSubstring">
  2553. <mutation at1="true" at2="true"></mutation>
  2554. <field name="WHERE1">FROM_START</field>
  2555. <field name="WHERE2">FROM_END</field>
  2556. <value name="STRING">
  2557. <block type="variables_get">
  2558. <field name="VAR">text</field>
  2559. </block>
  2560. </value>
  2561. <value name="AT1">
  2562. <block type="unittest_adjustindex">
  2563. <value name="INDEX">
  2564. <block type="math_number">
  2565. <field name="NUM">0</field>
  2566. </block>
  2567. </value>
  2568. </block>
  2569. </value>
  2570. <value name="AT2">
  2571. <block type="unittest_adjustindex">
  2572. <value name="INDEX">
  2573. <block type="math_number">
  2574. <field name="NUM">0</field>
  2575. </block>
  2576. </value>
  2577. </block>
  2578. </value>
  2579. </block>
  2580. </value>
  2581. <value name="EXPECTED">
  2582. <block type="text">
  2583. <field name="TEXT">123456789</field>
  2584. </block>
  2585. </value>
  2586. <next>
  2587. <block type="unittest_assertequals" inline="false">
  2588. <value name="MESSAGE">
  2589. <block type="text">
  2590. <field name="TEXT">substring all with #-end # simple</field>
  2591. </block>
  2592. </value>
  2593. <value name="ACTUAL">
  2594. <block type="text_getSubstring">
  2595. <mutation at1="true" at2="true"></mutation>
  2596. <field name="WHERE1">FROM_END</field>
  2597. <field name="WHERE2">FROM_START</field>
  2598. <value name="STRING">
  2599. <block type="variables_get">
  2600. <field name="VAR">text</field>
  2601. </block>
  2602. </value>
  2603. <value name="AT1">
  2604. <block type="unittest_adjustindex">
  2605. <value name="INDEX">
  2606. <block type="math_number">
  2607. <field name="NUM">8</field>
  2608. </block>
  2609. </value>
  2610. </block>
  2611. </value>
  2612. <value name="AT2">
  2613. <block type="unittest_adjustindex">
  2614. <value name="INDEX">
  2615. <block type="math_number">
  2616. <field name="NUM">8</field>
  2617. </block>
  2618. </value>
  2619. </block>
  2620. </value>
  2621. </block>
  2622. </value>
  2623. <value name="EXPECTED">
  2624. <block type="text">
  2625. <field name="TEXT">123456789</field>
  2626. </block>
  2627. </value>
  2628. <next>
  2629. <block type="unittest_assertequals" inline="false">
  2630. <value name="MESSAGE">
  2631. <block type="text">
  2632. <field name="TEXT">substring all with # #-end math simple</field>
  2633. </block>
  2634. </value>
  2635. <value name="ACTUAL">
  2636. <block type="text_getSubstring">
  2637. <mutation at1="true" at2="true"></mutation>
  2638. <field name="WHERE1">FROM_START</field>
  2639. <field name="WHERE2">FROM_END</field>
  2640. <comment pinned="false" h="94" w="320">Checks that the whole string is properly retrieved even if the value for start and end is not a simple number. This is especially important in generators where substring uses [x:length - y] for # #-end.</comment>
  2641. <value name="STRING">
  2642. <block type="variables_get">
  2643. <field name="VAR">text</field>
  2644. </block>
  2645. </value>
  2646. <value name="AT1">
  2647. <block type="math_arithmetic">
  2648. <field name="OP">ADD</field>
  2649. <value name="A">
  2650. <block type="math_number">
  2651. <field name="NUM">0</field>
  2652. </block>
  2653. </value>
  2654. <value name="B">
  2655. <block type="unittest_adjustindex">
  2656. <value name="INDEX">
  2657. <block type="math_number">
  2658. <field name="NUM">0</field>
  2659. </block>
  2660. </value>
  2661. </block>
  2662. </value>
  2663. </block>
  2664. </value>
  2665. <value name="AT2">
  2666. <block type="math_arithmetic">
  2667. <field name="OP">ADD</field>
  2668. <value name="A">
  2669. <block type="math_number">
  2670. <field name="NUM">0</field>
  2671. </block>
  2672. </value>
  2673. <value name="B">
  2674. <block type="unittest_adjustindex">
  2675. <value name="INDEX">
  2676. <block type="math_number">
  2677. <field name="NUM">0</field>
  2678. </block>
  2679. </value>
  2680. </block>
  2681. </value>
  2682. </block>
  2683. </value>
  2684. </block>
  2685. </value>
  2686. <value name="EXPECTED">
  2687. <block type="text">
  2688. <field name="TEXT">123456789</field>
  2689. </block>
  2690. </value>
  2691. </block>
  2692. </next>
  2693. </block>
  2694. </next>
  2695. </block>
  2696. </next>
  2697. </block>
  2698. </next>
  2699. </block>
  2700. </next>
  2701. </block>
  2702. </next>
  2703. </block>
  2704. </next>
  2705. </block>
  2706. </next>
  2707. </block>
  2708. </next>
  2709. </block>
  2710. </next>
  2711. </block>
  2712. </next>
  2713. </block>
  2714. </next>
  2715. </block>
  2716. </next>
  2717. </block>
  2718. </next>
  2719. </block>
  2720. </statement>
  2721. </block>
  2722. <block type="procedures_defnoreturn" x="13" y="8388">
  2723. <field name="NAME">test substring complex</field>
  2724. <comment pinned="false" h="80" w="160">Tests the "get substring" block with a function call.</comment>
  2725. <statement name="STACK">
  2726. <block type="variables_set">
  2727. <field name="VAR">number of calls</field>
  2728. <value name="VALUE">
  2729. <block type="math_number">
  2730. <field name="NUM">0</field>
  2731. </block>
  2732. </value>
  2733. <next>
  2734. <block type="unittest_assertequals" inline="false">
  2735. <value name="MESSAGE">
  2736. <block type="text">
  2737. <field name="TEXT">substring # complex</field>
  2738. </block>
  2739. </value>
  2740. <value name="ACTUAL">
  2741. <block type="text_getSubstring">
  2742. <mutation at1="true" at2="true"></mutation>
  2743. <field name="WHERE1">FROM_START</field>
  2744. <field name="WHERE2">FROM_START</field>
  2745. <value name="STRING">
  2746. <block type="procedures_callreturn">
  2747. <mutation name="get numbers"></mutation>
  2748. </block>
  2749. </value>
  2750. <value name="AT1">
  2751. <block type="unittest_adjustindex">
  2752. <value name="INDEX">
  2753. <block type="math_number">
  2754. <field name="NUM">1</field>
  2755. </block>
  2756. </value>
  2757. </block>
  2758. </value>
  2759. <value name="AT2">
  2760. <block type="unittest_adjustindex">
  2761. <value name="INDEX">
  2762. <block type="math_number">
  2763. <field name="NUM">2</field>
  2764. </block>
  2765. </value>
  2766. </block>
  2767. </value>
  2768. </block>
  2769. </value>
  2770. <value name="EXPECTED">
  2771. <block type="text">
  2772. <field name="TEXT">23</field>
  2773. </block>
  2774. </value>
  2775. <next>
  2776. <block type="procedures_callnoreturn" inline="true">
  2777. <mutation name="check number of calls">
  2778. <arg name="test name"></arg>
  2779. </mutation>
  2780. <value name="ARG0">
  2781. <block type="text">
  2782. <field name="TEXT">substring # complex</field>
  2783. </block>
  2784. </value>
  2785. <next>
  2786. <block type="variables_set">
  2787. <field name="VAR">number of calls</field>
  2788. <value name="VALUE">
  2789. <block type="math_number">
  2790. <field name="NUM">0</field>
  2791. </block>
  2792. </value>
  2793. <next>
  2794. <block type="unittest_assertequals" inline="false">
  2795. <value name="MESSAGE">
  2796. <block type="text">
  2797. <field name="TEXT">substring # complex order</field>
  2798. </block>
  2799. </value>
  2800. <value name="ACTUAL">
  2801. <block type="text_getSubstring">
  2802. <mutation at1="true" at2="true"></mutation>
  2803. <field name="WHERE1">FROM_START</field>
  2804. <field name="WHERE2">FROM_START</field>
  2805. <value name="STRING">
  2806. <block type="logic_ternary">
  2807. <value name="IF">
  2808. <block type="logic_boolean">
  2809. <field name="BOOL">TRUE</field>
  2810. </block>
  2811. </value>
  2812. <value name="THEN">
  2813. <block type="procedures_callreturn">
  2814. <mutation name="get numbers"></mutation>
  2815. </block>
  2816. </value>
  2817. <value name="ELSE">
  2818. <block type="logic_null"></block>
  2819. </value>
  2820. </block>
  2821. </value>
  2822. <value name="AT1">
  2823. <block type="logic_ternary">
  2824. <value name="IF">
  2825. <block type="logic_boolean">
  2826. <field name="BOOL">TRUE</field>
  2827. </block>
  2828. </value>
  2829. <value name="THEN">
  2830. <block type="unittest_adjustindex">
  2831. <value name="INDEX">
  2832. <block type="math_number">
  2833. <field name="NUM">1</field>
  2834. </block>
  2835. </value>
  2836. </block>
  2837. </value>
  2838. <value name="ELSE">
  2839. <block type="logic_null"></block>
  2840. </value>
  2841. </block>
  2842. </value>
  2843. <value name="AT2">
  2844. <block type="logic_ternary">
  2845. <value name="IF">
  2846. <block type="logic_boolean">
  2847. <field name="BOOL">TRUE</field>
  2848. </block>
  2849. </value>
  2850. <value name="THEN">
  2851. <block type="unittest_adjustindex">
  2852. <value name="INDEX">
  2853. <block type="math_number">
  2854. <field name="NUM">2</field>
  2855. </block>
  2856. </value>
  2857. </block>
  2858. </value>
  2859. <value name="ELSE">
  2860. <block type="logic_null"></block>
  2861. </value>
  2862. </block>
  2863. </value>
  2864. </block>
  2865. </value>
  2866. <value name="EXPECTED">
  2867. <block type="text">
  2868. <field name="TEXT">23</field>
  2869. </block>
  2870. </value>
  2871. <next>
  2872. <block type="procedures_callnoreturn" inline="true">
  2873. <mutation name="check number of calls">
  2874. <arg name="test name"></arg>
  2875. </mutation>
  2876. <value name="ARG0">
  2877. <block type="text">
  2878. <field name="TEXT">substring # complex order</field>
  2879. </block>
  2880. </value>
  2881. <next>
  2882. <block type="variables_set">
  2883. <field name="VAR">number of calls</field>
  2884. <value name="VALUE">
  2885. <block type="math_number">
  2886. <field name="NUM">0</field>
  2887. </block>
  2888. </value>
  2889. <next>
  2890. <block type="unittest_assertequals" inline="false">
  2891. <value name="MESSAGE">
  2892. <block type="text">
  2893. <field name="TEXT">substring #-end complex</field>
  2894. </block>
  2895. </value>
  2896. <value name="ACTUAL">
  2897. <block type="text_getSubstring">
  2898. <mutation at1="true" at2="true"></mutation>
  2899. <field name="WHERE1">FROM_END</field>
  2900. <field name="WHERE2">FROM_END</field>
  2901. <comment pinned="false" h="83" w="259">The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index.</comment>
  2902. <value name="STRING">
  2903. <block type="procedures_callreturn">
  2904. <mutation name="get numbers"></mutation>
  2905. </block>
  2906. </value>
  2907. <value name="AT1">
  2908. <block type="unittest_adjustindex">
  2909. <value name="INDEX">
  2910. <block type="math_number">
  2911. <field name="NUM">2</field>
  2912. </block>
  2913. </value>
  2914. </block>
  2915. </value>
  2916. <value name="AT2">
  2917. <block type="unittest_adjustindex">
  2918. <value name="INDEX">
  2919. <block type="math_number">
  2920. <field name="NUM">1</field>
  2921. </block>
  2922. </value>
  2923. </block>
  2924. </value>
  2925. </block>
  2926. </value>
  2927. <value name="EXPECTED">
  2928. <block type="text">
  2929. <field name="TEXT">78</field>
  2930. </block>
  2931. </value>
  2932. <next>
  2933. <block type="procedures_callnoreturn" inline="true">
  2934. <mutation name="check number of calls">
  2935. <arg name="test name"></arg>
  2936. </mutation>
  2937. <value name="ARG0">
  2938. <block type="text">
  2939. <field name="TEXT">substring #-end complex</field>
  2940. </block>
  2941. </value>
  2942. <next>
  2943. <block type="variables_set">
  2944. <field name="VAR">number of calls</field>
  2945. <value name="VALUE">
  2946. <block type="math_number">
  2947. <field name="NUM">0</field>
  2948. </block>
  2949. </value>
  2950. <next>
  2951. <block type="unittest_assertequals" inline="false">
  2952. <value name="MESSAGE">
  2953. <block type="text">
  2954. <field name="TEXT">substring #-end order order</field>
  2955. </block>
  2956. </value>
  2957. <value name="ACTUAL">
  2958. <block type="text_getSubstring">
  2959. <mutation at1="true" at2="true"></mutation>
  2960. <field name="WHERE1">FROM_END</field>
  2961. <field name="WHERE2">FROM_END</field>
  2962. <value name="STRING">
  2963. <block type="logic_ternary">
  2964. <value name="IF">
  2965. <block type="logic_boolean">
  2966. <field name="BOOL">TRUE</field>
  2967. </block>
  2968. </value>
  2969. <value name="THEN">
  2970. <block type="procedures_callreturn">
  2971. <mutation name="get numbers"></mutation>
  2972. </block>
  2973. </value>
  2974. <value name="ELSE">
  2975. <block type="logic_null"></block>
  2976. </value>
  2977. </block>
  2978. </value>
  2979. <value name="AT1">
  2980. <block type="math_arithmetic">
  2981. <field name="OP">ADD</field>
  2982. <value name="A">
  2983. <block type="math_number">
  2984. <field name="NUM">0</field>
  2985. </block>
  2986. </value>
  2987. <value name="B">
  2988. <block type="unittest_adjustindex">
  2989. <value name="INDEX">
  2990. <block type="math_number">
  2991. <field name="NUM">2</field>
  2992. </block>
  2993. </value>
  2994. </block>
  2995. </value>
  2996. </block>
  2997. </value>
  2998. <value name="AT2">
  2999. <block type="math_arithmetic">
  3000. <field name="OP">ADD</field>
  3001. <value name="A">
  3002. <block type="math_number">
  3003. <field name="NUM">0</field>
  3004. </block>
  3005. </value>
  3006. <value name="B">
  3007. <block type="unittest_adjustindex">
  3008. <value name="INDEX">
  3009. <block type="math_number">
  3010. <field name="NUM">1</field>
  3011. </block>
  3012. </value>
  3013. </block>
  3014. </value>
  3015. </block>
  3016. </value>
  3017. </block>
  3018. </value>
  3019. <value name="EXPECTED">
  3020. <block type="text">
  3021. <field name="TEXT">78</field>
  3022. </block>
  3023. </value>
  3024. <next>
  3025. <block type="procedures_callnoreturn" inline="true">
  3026. <mutation name="check number of calls">
  3027. <arg name="test name"></arg>
  3028. </mutation>
  3029. <value name="ARG0">
  3030. <block type="text">
  3031. <field name="TEXT">substring #-end order order</field>
  3032. </block>
  3033. </value>
  3034. <next>
  3035. <block type="variables_set">
  3036. <field name="VAR">number of calls</field>
  3037. <value name="VALUE">
  3038. <block type="math_number">
  3039. <field name="NUM">0</field>
  3040. </block>
  3041. </value>
  3042. <next>
  3043. <block type="unittest_assertequals" inline="false">
  3044. <value name="MESSAGE">
  3045. <block type="text">
  3046. <field name="TEXT">substring first-last</field>
  3047. </block>
  3048. </value>
  3049. <value name="ACTUAL">
  3050. <block type="text_getSubstring">
  3051. <mutation at1="false" at2="false"></mutation>
  3052. <field name="WHERE1">FIRST</field>
  3053. <field name="WHERE2">LAST</field>
  3054. <value name="STRING">
  3055. <block type="procedures_callreturn">
  3056. <mutation name="get numbers"></mutation>
  3057. </block>
  3058. </value>
  3059. </block>
  3060. </value>
  3061. <value name="EXPECTED">
  3062. <block type="variables_get">
  3063. <field name="VAR">text</field>
  3064. </block>
  3065. </value>
  3066. <next>
  3067. <block type="procedures_callnoreturn" inline="true">
  3068. <mutation name="check number of calls">
  3069. <arg name="test name"></arg>
  3070. </mutation>
  3071. <value name="ARG0">
  3072. <block type="text">
  3073. <field name="TEXT">substring first-last</field>
  3074. </block>
  3075. </value>
  3076. <next>
  3077. <block type="variables_set">
  3078. <field name="VAR">number of calls</field>
  3079. <value name="VALUE">
  3080. <block type="math_number">
  3081. <field name="NUM">0</field>
  3082. </block>
  3083. </value>
  3084. <next>
  3085. <block type="unittest_assertequals" inline="false">
  3086. <value name="MESSAGE">
  3087. <block type="text">
  3088. <field name="TEXT">substring # #-end complex</field>
  3089. </block>
  3090. </value>
  3091. <value name="ACTUAL">
  3092. <block type="text_getSubstring">
  3093. <mutation at1="true" at2="true"></mutation>
  3094. <field name="WHERE1">FROM_START</field>
  3095. <field name="WHERE2">FROM_END</field>
  3096. <value name="STRING">
  3097. <block type="procedures_callreturn">
  3098. <mutation name="get numbers"></mutation>
  3099. </block>
  3100. </value>
  3101. <value name="AT1">
  3102. <block type="unittest_adjustindex">
  3103. <value name="INDEX">
  3104. <block type="math_number">
  3105. <field name="NUM">1</field>
  3106. </block>
  3107. </value>
  3108. </block>
  3109. </value>
  3110. <value name="AT2">
  3111. <block type="unittest_adjustindex">
  3112. <value name="INDEX">
  3113. <block type="math_number">
  3114. <field name="NUM">1</field>
  3115. </block>
  3116. </value>
  3117. </block>
  3118. </value>
  3119. </block>
  3120. </value>
  3121. <value name="EXPECTED">
  3122. <block type="text">
  3123. <field name="TEXT">2345678</field>
  3124. </block>
  3125. </value>
  3126. <next>
  3127. <block type="procedures_callnoreturn" inline="true">
  3128. <mutation name="check number of calls">
  3129. <arg name="test name"></arg>
  3130. </mutation>
  3131. <value name="ARG0">
  3132. <block type="text">
  3133. <field name="TEXT">substring # #-end complex</field>
  3134. </block>
  3135. </value>
  3136. <next>
  3137. <block type="variables_set">
  3138. <field name="VAR">number of calls</field>
  3139. <value name="VALUE">
  3140. <block type="math_number">
  3141. <field name="NUM">0</field>
  3142. </block>
  3143. </value>
  3144. <next>
  3145. <block type="unittest_assertequals" inline="false">
  3146. <value name="MESSAGE">
  3147. <block type="text">
  3148. <field name="TEXT">substring #-end # complex</field>
  3149. </block>
  3150. </value>
  3151. <value name="ACTUAL">
  3152. <block type="text_getSubstring">
  3153. <mutation at1="true" at2="true"></mutation>
  3154. <field name="WHERE1">FROM_END</field>
  3155. <field name="WHERE2">FROM_START</field>
  3156. <value name="STRING">
  3157. <block type="procedures_callreturn">
  3158. <mutation name="get numbers"></mutation>
  3159. </block>
  3160. </value>
  3161. <value name="AT1">
  3162. <block type="unittest_adjustindex">
  3163. <value name="INDEX">
  3164. <block type="math_number">
  3165. <field name="NUM">6</field>
  3166. </block>
  3167. </value>
  3168. </block>
  3169. </value>
  3170. <value name="AT2">
  3171. <block type="unittest_adjustindex">
  3172. <value name="INDEX">
  3173. <block type="math_number">
  3174. <field name="NUM">3</field>
  3175. </block>
  3176. </value>
  3177. </block>
  3178. </value>
  3179. </block>
  3180. </value>
  3181. <value name="EXPECTED">
  3182. <block type="text">
  3183. <field name="TEXT">34</field>
  3184. </block>
  3185. </value>
  3186. <next>
  3187. <block type="procedures_callnoreturn" inline="true">
  3188. <mutation name="check number of calls">
  3189. <arg name="test name"></arg>
  3190. </mutation>
  3191. <value name="ARG0">
  3192. <block type="text">
  3193. <field name="TEXT">substring #-end # complex</field>
  3194. </block>
  3195. </value>
  3196. <next>
  3197. <block type="variables_set">
  3198. <field name="VAR">number of calls</field>
  3199. <value name="VALUE">
  3200. <block type="math_number">
  3201. <field name="NUM">0</field>
  3202. </block>
  3203. </value>
  3204. <next>
  3205. <block type="unittest_assertequals" inline="false">
  3206. <value name="MESSAGE">
  3207. <block type="text">
  3208. <field name="TEXT">substring first # complex</field>
  3209. </block>
  3210. </value>
  3211. <value name="ACTUAL">
  3212. <block type="text_getSubstring">
  3213. <mutation at1="false" at2="true"></mutation>
  3214. <field name="WHERE1">FIRST</field>
  3215. <field name="WHERE2">FROM_START</field>
  3216. <value name="STRING">
  3217. <block type="procedures_callreturn">
  3218. <mutation name="get numbers"></mutation>
  3219. </block>
  3220. </value>
  3221. <value name="AT2">
  3222. <block type="unittest_adjustindex">
  3223. <value name="INDEX">
  3224. <block type="math_number">
  3225. <field name="NUM">3</field>
  3226. </block>
  3227. </value>
  3228. </block>
  3229. </value>
  3230. </block>
  3231. </value>
  3232. <value name="EXPECTED">
  3233. <block type="text">
  3234. <field name="TEXT">1234</field>
  3235. </block>
  3236. </value>
  3237. <next>
  3238. <block type="procedures_callnoreturn" inline="true">
  3239. <mutation name="check number of calls">
  3240. <arg name="test name"></arg>
  3241. </mutation>
  3242. <value name="ARG0">
  3243. <block type="text">
  3244. <field name="TEXT">substring first # complex</field>
  3245. </block>
  3246. </value>
  3247. <next>
  3248. <block type="variables_set">
  3249. <field name="VAR">number of calls</field>
  3250. <value name="VALUE">
  3251. <block type="math_number">
  3252. <field name="NUM">0</field>
  3253. </block>
  3254. </value>
  3255. <next>
  3256. <block type="unittest_assertequals" inline="false">
  3257. <value name="MESSAGE">
  3258. <block type="text">
  3259. <field name="TEXT">substring first #-end complex</field>
  3260. </block>
  3261. </value>
  3262. <value name="ACTUAL">
  3263. <block type="text_getSubstring">
  3264. <mutation at1="false" at2="true"></mutation>
  3265. <field name="WHERE1">FIRST</field>
  3266. <field name="WHERE2">FROM_END</field>
  3267. <value name="STRING">
  3268. <block type="procedures_callreturn">
  3269. <mutation name="get numbers"></mutation>
  3270. </block>
  3271. </value>
  3272. <value name="AT2">
  3273. <block type="unittest_adjustindex">
  3274. <value name="INDEX">
  3275. <block type="math_number">
  3276. <field name="NUM">1</field>
  3277. </block>
  3278. </value>
  3279. </block>
  3280. </value>
  3281. </block>
  3282. </value>
  3283. <value name="EXPECTED">
  3284. <block type="text">
  3285. <field name="TEXT">12345678</field>
  3286. </block>
  3287. </value>
  3288. <next>
  3289. <block type="procedures_callnoreturn" inline="true">
  3290. <mutation name="check number of calls">
  3291. <arg name="test name"></arg>
  3292. </mutation>
  3293. <value name="ARG0">
  3294. <block type="text">
  3295. <field name="TEXT">substring first #-end complex</field>
  3296. </block>
  3297. </value>
  3298. <next>
  3299. <block type="variables_set">
  3300. <field name="VAR">number of calls</field>
  3301. <value name="VALUE">
  3302. <block type="math_number">
  3303. <field name="NUM">0</field>
  3304. </block>
  3305. </value>
  3306. <next>
  3307. <block type="unittest_assertequals" inline="false">
  3308. <value name="MESSAGE">
  3309. <block type="text">
  3310. <field name="TEXT">substring # last complex</field>
  3311. </block>
  3312. </value>
  3313. <value name="ACTUAL">
  3314. <block type="text_getSubstring">
  3315. <mutation at1="true" at2="false"></mutation>
  3316. <field name="WHERE1">FROM_START</field>
  3317. <field name="WHERE2">LAST</field>
  3318. <value name="STRING">
  3319. <block type="procedures_callreturn">
  3320. <mutation name="get numbers"></mutation>
  3321. </block>
  3322. </value>
  3323. <value name="AT1">
  3324. <block type="unittest_adjustindex">
  3325. <value name="INDEX">
  3326. <block type="math_number">
  3327. <field name="NUM">6</field>
  3328. </block>
  3329. </value>
  3330. </block>
  3331. </value>
  3332. </block>
  3333. </value>
  3334. <value name="EXPECTED">
  3335. <block type="text">
  3336. <field name="TEXT">789</field>
  3337. </block>
  3338. </value>
  3339. <next>
  3340. <block type="procedures_callnoreturn" inline="true">
  3341. <mutation name="check number of calls">
  3342. <arg name="test name"></arg>
  3343. </mutation>
  3344. <value name="ARG0">
  3345. <block type="text">
  3346. <field name="TEXT">substring # last complex</field>
  3347. </block>
  3348. </value>
  3349. <next>
  3350. <block type="variables_set">
  3351. <field name="VAR">number of calls</field>
  3352. <value name="VALUE">
  3353. <block type="math_number">
  3354. <field name="NUM">0</field>
  3355. </block>
  3356. </value>
  3357. <next>
  3358. <block type="unittest_assertequals" inline="false">
  3359. <value name="MESSAGE">
  3360. <block type="text">
  3361. <field name="TEXT">substring #-end last complex</field>
  3362. </block>
  3363. </value>
  3364. <value name="ACTUAL">
  3365. <block type="text_getSubstring">
  3366. <mutation at1="true" at2="false"></mutation>
  3367. <field name="WHERE1">FROM_END</field>
  3368. <field name="WHERE2">LAST</field>
  3369. <value name="STRING">
  3370. <block type="procedures_callreturn">
  3371. <mutation name="get numbers"></mutation>
  3372. </block>
  3373. </value>
  3374. <value name="AT1">
  3375. <block type="unittest_adjustindex">
  3376. <value name="INDEX">
  3377. <block type="math_number">
  3378. <field name="NUM">2</field>
  3379. </block>
  3380. </value>
  3381. </block>
  3382. </value>
  3383. </block>
  3384. </value>
  3385. <value name="EXPECTED">
  3386. <block type="text">
  3387. <field name="TEXT">789</field>
  3388. </block>
  3389. </value>
  3390. <next>
  3391. <block type="procedures_callnoreturn" inline="true">
  3392. <mutation name="check number of calls">
  3393. <arg name="test name"></arg>
  3394. </mutation>
  3395. <value name="ARG0">
  3396. <block type="text">
  3397. <field name="TEXT">substring #-end last complex</field>
  3398. </block>
  3399. </value>
  3400. <next>
  3401. <block type="variables_set">
  3402. <field name="VAR">number of calls</field>
  3403. <value name="VALUE">
  3404. <block type="math_number">
  3405. <field name="NUM">0</field>
  3406. </block>
  3407. </value>
  3408. <next>
  3409. <block type="unittest_assertequals" inline="false">
  3410. <value name="MESSAGE">
  3411. <block type="text">
  3412. <field name="TEXT">substring all with # #-end complex</field>
  3413. </block>
  3414. </value>
  3415. <value name="ACTUAL">
  3416. <block type="text_getSubstring">
  3417. <mutation at1="true" at2="true"></mutation>
  3418. <field name="WHERE1">FROM_START</field>
  3419. <field name="WHERE2">FROM_END</field>
  3420. <value name="STRING">
  3421. <block type="procedures_callreturn">
  3422. <mutation name="get numbers"></mutation>
  3423. </block>
  3424. </value>
  3425. <value name="AT1">
  3426. <block type="unittest_adjustindex">
  3427. <value name="INDEX">
  3428. <block type="math_number">
  3429. <field name="NUM">0</field>
  3430. </block>
  3431. </value>
  3432. </block>
  3433. </value>
  3434. <value name="AT2">
  3435. <block type="unittest_adjustindex">
  3436. <value name="INDEX">
  3437. <block type="math_number">
  3438. <field name="NUM">0</field>
  3439. </block>
  3440. </value>
  3441. </block>
  3442. </value>
  3443. </block>
  3444. </value>
  3445. <value name="EXPECTED">
  3446. <block type="text">
  3447. <field name="TEXT">123456789</field>
  3448. </block>
  3449. </value>
  3450. <next>
  3451. <block type="procedures_callnoreturn" inline="true">
  3452. <mutation name="check number of calls">
  3453. <arg name="test name"></arg>
  3454. </mutation>
  3455. <value name="ARG0">
  3456. <block type="text">
  3457. <field name="TEXT">substring all with # #-end complex</field>
  3458. </block>
  3459. </value>
  3460. <next>
  3461. <block type="variables_set">
  3462. <field name="VAR">number of calls</field>
  3463. <value name="VALUE">
  3464. <block type="math_number">
  3465. <field name="NUM">0</field>
  3466. </block>
  3467. </value>
  3468. <next>
  3469. <block type="unittest_assertequals" inline="false">
  3470. <value name="MESSAGE">
  3471. <block type="text">
  3472. <field name="TEXT">substring all with #-end # complex</field>
  3473. </block>
  3474. </value>
  3475. <value name="ACTUAL">
  3476. <block type="text_getSubstring">
  3477. <mutation at1="true" at2="true"></mutation>
  3478. <field name="WHERE1">FROM_END</field>
  3479. <field name="WHERE2">FROM_START</field>
  3480. <value name="STRING">
  3481. <block type="procedures_callreturn">
  3482. <mutation name="get numbers"></mutation>
  3483. </block>
  3484. </value>
  3485. <value name="AT1">
  3486. <block type="unittest_adjustindex">
  3487. <value name="INDEX">
  3488. <block type="math_number">
  3489. <field name="NUM">8</field>
  3490. </block>
  3491. </value>
  3492. </block>
  3493. </value>
  3494. <value name="AT2">
  3495. <block type="unittest_adjustindex">
  3496. <value name="INDEX">
  3497. <block type="math_number">
  3498. <field name="NUM">8</field>
  3499. </block>
  3500. </value>
  3501. </block>
  3502. </value>
  3503. </block>
  3504. </value>
  3505. <value name="EXPECTED">
  3506. <block type="text">
  3507. <field name="TEXT">123456789</field>
  3508. </block>
  3509. </value>
  3510. <next>
  3511. <block type="procedures_callnoreturn" inline="true">
  3512. <mutation name="check number of calls">
  3513. <arg name="test name"></arg>
  3514. </mutation>
  3515. <value name="ARG0">
  3516. <block type="text">
  3517. <field name="TEXT">substring all with #-end # complex</field>
  3518. </block>
  3519. </value>
  3520. <next>
  3521. <block type="variables_set">
  3522. <field name="VAR">number of calls</field>
  3523. <value name="VALUE">
  3524. <block type="math_number">
  3525. <field name="NUM">0</field>
  3526. </block>
  3527. </value>
  3528. <next>
  3529. <block type="unittest_assertequals" inline="false">
  3530. <value name="MESSAGE">
  3531. <block type="text">
  3532. <field name="TEXT">substring all with # #-end math complex</field>
  3533. </block>
  3534. </value>
  3535. <value name="ACTUAL">
  3536. <block type="text_getSubstring">
  3537. <mutation at1="true" at2="true"></mutation>
  3538. <field name="WHERE1">FROM_START</field>
  3539. <field name="WHERE2">FROM_END</field>
  3540. <comment pinned="false" h="92" w="323">Checks that the whole string is properly retrieved even if the value for start and end is not a simple number. This is especially important in generators where substring uses [x:length - y] for # #-end.</comment>
  3541. <value name="STRING">
  3542. <block type="procedures_callreturn">
  3543. <mutation name="get numbers"></mutation>
  3544. </block>
  3545. </value>
  3546. <value name="AT1">
  3547. <block type="math_arithmetic">
  3548. <field name="OP">ADD</field>
  3549. <value name="A">
  3550. <block type="math_number">
  3551. <field name="NUM">0</field>
  3552. </block>
  3553. </value>
  3554. <value name="B">
  3555. <block type="unittest_adjustindex">
  3556. <value name="INDEX">
  3557. <block type="math_number">
  3558. <field name="NUM">0</field>
  3559. </block>
  3560. </value>
  3561. </block>
  3562. </value>
  3563. </block>
  3564. </value>
  3565. <value name="AT2">
  3566. <block type="math_arithmetic">
  3567. <field name="OP">ADD</field>
  3568. <value name="A">
  3569. <block type="math_number">
  3570. <field name="NUM">0</field>
  3571. </block>
  3572. </value>
  3573. <value name="B">
  3574. <block type="unittest_adjustindex">
  3575. <value name="INDEX">
  3576. <block type="math_number">
  3577. <field name="NUM">0</field>
  3578. </block>
  3579. </value>
  3580. </block>
  3581. </value>
  3582. </block>
  3583. </value>
  3584. </block>
  3585. </value>
  3586. <value name="EXPECTED">
  3587. <block type="text">
  3588. <field name="TEXT">123456789</field>
  3589. </block>
  3590. </value>
  3591. <next>
  3592. <block type="procedures_callnoreturn" inline="true">
  3593. <mutation name="check number of calls">
  3594. <arg name="test name"></arg>
  3595. </mutation>
  3596. <value name="ARG0">
  3597. <block type="text">
  3598. <field name="TEXT">substring all with # #-end math complex</field>
  3599. </block>
  3600. </value>
  3601. </block>
  3602. </next>
  3603. </block>
  3604. </next>
  3605. </block>
  3606. </next>
  3607. </block>
  3608. </next>
  3609. </block>
  3610. </next>
  3611. </block>
  3612. </next>
  3613. </block>
  3614. </next>
  3615. </block>
  3616. </next>
  3617. </block>
  3618. </next>
  3619. </block>
  3620. </next>
  3621. </block>
  3622. </next>
  3623. </block>
  3624. </next>
  3625. </block>
  3626. </next>
  3627. </block>
  3628. </next>
  3629. </block>
  3630. </next>
  3631. </block>
  3632. </next>
  3633. </block>
  3634. </next>
  3635. </block>
  3636. </next>
  3637. </block>
  3638. </next>
  3639. </block>
  3640. </next>
  3641. </block>
  3642. </next>
  3643. </block>
  3644. </next>
  3645. </block>
  3646. </next>
  3647. </block>
  3648. </next>
  3649. </block>
  3650. </next>
  3651. </block>
  3652. </next>
  3653. </block>
  3654. </next>
  3655. </block>
  3656. </next>
  3657. </block>
  3658. </next>
  3659. </block>
  3660. </next>
  3661. </block>
  3662. </next>
  3663. </block>
  3664. </next>
  3665. </block>
  3666. </next>
  3667. </block>
  3668. </next>
  3669. </block>
  3670. </next>
  3671. </block>
  3672. </next>
  3673. </block>
  3674. </next>
  3675. </block>
  3676. </next>
  3677. </block>
  3678. </next>
  3679. </block>
  3680. </next>
  3681. </block>
  3682. </next>
  3683. </block>
  3684. </statement>
  3685. </block>
  3686. <block type="procedures_defnoreturn" x="13" y="10838">
  3687. <field name="NAME">test case</field>
  3688. <comment pinned="false" h="80" w="160">Tests the "change casing" block.</comment>
  3689. <statement name="STACK">
  3690. <block type="variables_set">
  3691. <field name="VAR">text</field>
  3692. <value name="VALUE">
  3693. <block type="text">
  3694. <field name="TEXT">Hello World</field>
  3695. </block>
  3696. </value>
  3697. <next>
  3698. <block type="unittest_assertequals" inline="false">
  3699. <value name="MESSAGE">
  3700. <block type="text">
  3701. <field name="TEXT">uppercase</field>
  3702. </block>
  3703. </value>
  3704. <value name="ACTUAL">
  3705. <block type="text_changeCase" inline="false">
  3706. <field name="CASE">UPPERCASE</field>
  3707. <value name="TEXT">
  3708. <block type="variables_get">
  3709. <field name="VAR">text</field>
  3710. </block>
  3711. </value>
  3712. </block>
  3713. </value>
  3714. <value name="EXPECTED">
  3715. <block type="text">
  3716. <field name="TEXT">HELLO WORLD</field>
  3717. </block>
  3718. </value>
  3719. <next>
  3720. <block type="unittest_assertequals" inline="false">
  3721. <value name="MESSAGE">
  3722. <block type="text">
  3723. <field name="TEXT">uppercase order</field>
  3724. </block>
  3725. </value>
  3726. <value name="ACTUAL">
  3727. <block type="text_changeCase" inline="false">
  3728. <field name="CASE">UPPERCASE</field>
  3729. <value name="TEXT">
  3730. <block type="logic_ternary" inline="true">
  3731. <value name="IF">
  3732. <block type="logic_boolean">
  3733. <field name="BOOL">TRUE</field>
  3734. </block>
  3735. </value>
  3736. <value name="THEN">
  3737. <block type="variables_get">
  3738. <field name="VAR">text</field>
  3739. </block>
  3740. </value>
  3741. <value name="ELSE">
  3742. <block type="logic_null"></block>
  3743. </value>
  3744. </block>
  3745. </value>
  3746. </block>
  3747. </value>
  3748. <value name="EXPECTED">
  3749. <block type="text">
  3750. <field name="TEXT">HELLO WORLD</field>
  3751. </block>
  3752. </value>
  3753. <next>
  3754. <block type="variables_set">
  3755. <field name="VAR">text</field>
  3756. <value name="VALUE">
  3757. <block type="text">
  3758. <field name="TEXT">Hello World</field>
  3759. </block>
  3760. </value>
  3761. <next>
  3762. <block type="unittest_assertequals" inline="false">
  3763. <value name="MESSAGE">
  3764. <block type="text">
  3765. <field name="TEXT">lowercase</field>
  3766. </block>
  3767. </value>
  3768. <value name="ACTUAL">
  3769. <block type="text_changeCase" inline="false">
  3770. <field name="CASE">LOWERCASE</field>
  3771. <value name="TEXT">
  3772. <block type="variables_get">
  3773. <field name="VAR">text</field>
  3774. </block>
  3775. </value>
  3776. </block>
  3777. </value>
  3778. <value name="EXPECTED">
  3779. <block type="text">
  3780. <field name="TEXT">hello world</field>
  3781. </block>
  3782. </value>
  3783. <next>
  3784. <block type="unittest_assertequals" inline="false">
  3785. <value name="MESSAGE">
  3786. <block type="text">
  3787. <field name="TEXT">lowercase order</field>
  3788. </block>
  3789. </value>
  3790. <value name="ACTUAL">
  3791. <block type="text_changeCase" inline="false">
  3792. <field name="CASE">LOWERCASE</field>
  3793. <value name="TEXT">
  3794. <block type="logic_ternary" inline="true">
  3795. <value name="IF">
  3796. <block type="logic_boolean">
  3797. <field name="BOOL">TRUE</field>
  3798. </block>
  3799. </value>
  3800. <value name="THEN">
  3801. <block type="variables_get">
  3802. <field name="VAR">text</field>
  3803. </block>
  3804. </value>
  3805. <value name="ELSE">
  3806. <block type="logic_null"></block>
  3807. </value>
  3808. </block>
  3809. </value>
  3810. </block>
  3811. </value>
  3812. <value name="EXPECTED">
  3813. <block type="text">
  3814. <field name="TEXT">hello world</field>
  3815. </block>
  3816. </value>
  3817. <next>
  3818. <block type="variables_set">
  3819. <field name="VAR">text</field>
  3820. <value name="VALUE">
  3821. <block type="text">
  3822. <field name="TEXT">heLLo WorlD</field>
  3823. </block>
  3824. </value>
  3825. <next>
  3826. <block type="unittest_assertequals" inline="false">
  3827. <value name="MESSAGE">
  3828. <block type="text">
  3829. <field name="TEXT">titlecase</field>
  3830. </block>
  3831. </value>
  3832. <value name="ACTUAL">
  3833. <block type="text_changeCase" inline="false">
  3834. <field name="CASE">TITLECASE</field>
  3835. <value name="TEXT">
  3836. <block type="variables_get">
  3837. <field name="VAR">text</field>
  3838. </block>
  3839. </value>
  3840. </block>
  3841. </value>
  3842. <value name="EXPECTED">
  3843. <block type="text">
  3844. <field name="TEXT">Hello World</field>
  3845. </block>
  3846. </value>
  3847. <next>
  3848. <block type="unittest_assertequals" inline="false">
  3849. <value name="MESSAGE">
  3850. <block type="text">
  3851. <field name="TEXT">titlecase order</field>
  3852. </block>
  3853. </value>
  3854. <value name="ACTUAL">
  3855. <block type="text_changeCase" inline="false">
  3856. <field name="CASE">TITLECASE</field>
  3857. <value name="TEXT">
  3858. <block type="logic_ternary" inline="true">
  3859. <value name="IF">
  3860. <block type="logic_boolean">
  3861. <field name="BOOL">TRUE</field>
  3862. </block>
  3863. </value>
  3864. <value name="THEN">
  3865. <block type="variables_get">
  3866. <field name="VAR">text</field>
  3867. </block>
  3868. </value>
  3869. <value name="ELSE">
  3870. <block type="logic_null"></block>
  3871. </value>
  3872. </block>
  3873. </value>
  3874. </block>
  3875. </value>
  3876. <value name="EXPECTED">
  3877. <block type="text">
  3878. <field name="TEXT">Hello World</field>
  3879. </block>
  3880. </value>
  3881. </block>
  3882. </next>
  3883. </block>
  3884. </next>
  3885. </block>
  3886. </next>
  3887. </block>
  3888. </next>
  3889. </block>
  3890. </next>
  3891. </block>
  3892. </next>
  3893. </block>
  3894. </next>
  3895. </block>
  3896. </next>
  3897. </block>
  3898. </statement>
  3899. </block>
  3900. <block type="procedures_defnoreturn" x="13" y="11488">
  3901. <field name="NAME">test trim</field>
  3902. <comment pinned="false" h="80" w="160">Tests the "trim" block.</comment>
  3903. <statement name="STACK">
  3904. <block type="variables_set">
  3905. <field name="VAR">text</field>
  3906. <value name="VALUE">
  3907. <block type="text">
  3908. <field name="TEXT"> abc def </field>
  3909. </block>
  3910. </value>
  3911. <next>
  3912. <block type="unittest_assertequals" inline="false">
  3913. <value name="MESSAGE">
  3914. <block type="text">
  3915. <field name="TEXT">trim both</field>
  3916. </block>
  3917. </value>
  3918. <value name="ACTUAL">
  3919. <block type="text_trim" inline="false">
  3920. <field name="MODE">BOTH</field>
  3921. <value name="TEXT">
  3922. <block type="variables_get">
  3923. <field name="VAR">text</field>
  3924. </block>
  3925. </value>
  3926. </block>
  3927. </value>
  3928. <value name="EXPECTED">
  3929. <block type="text">
  3930. <field name="TEXT">abc def</field>
  3931. </block>
  3932. </value>
  3933. <next>
  3934. <block type="unittest_assertequals" inline="false">
  3935. <value name="MESSAGE">
  3936. <block type="text">
  3937. <field name="TEXT">trim both order</field>
  3938. </block>
  3939. </value>
  3940. <value name="ACTUAL">
  3941. <block type="text_trim" inline="false">
  3942. <field name="MODE">BOTH</field>
  3943. <value name="TEXT">
  3944. <block type="logic_ternary" inline="true">
  3945. <value name="IF">
  3946. <block type="logic_boolean">
  3947. <field name="BOOL">TRUE</field>
  3948. </block>
  3949. </value>
  3950. <value name="THEN">
  3951. <block type="variables_get">
  3952. <field name="VAR">text</field>
  3953. </block>
  3954. </value>
  3955. <value name="ELSE">
  3956. <block type="logic_null"></block>
  3957. </value>
  3958. </block>
  3959. </value>
  3960. </block>
  3961. </value>
  3962. <value name="EXPECTED">
  3963. <block type="text">
  3964. <field name="TEXT">abc def</field>
  3965. </block>
  3966. </value>
  3967. <next>
  3968. <block type="unittest_assertequals" inline="false">
  3969. <value name="MESSAGE">
  3970. <block type="text">
  3971. <field name="TEXT">trim left</field>
  3972. </block>
  3973. </value>
  3974. <value name="ACTUAL">
  3975. <block type="text_trim" inline="false">
  3976. <field name="MODE">LEFT</field>
  3977. <value name="TEXT">
  3978. <block type="variables_get">
  3979. <field name="VAR">text</field>
  3980. </block>
  3981. </value>
  3982. </block>
  3983. </value>
  3984. <value name="EXPECTED">
  3985. <block type="text">
  3986. <field name="TEXT">abc def </field>
  3987. </block>
  3988. </value>
  3989. <next>
  3990. <block type="unittest_assertequals" inline="false">
  3991. <value name="MESSAGE">
  3992. <block type="text">
  3993. <field name="TEXT">trim left order</field>
  3994. </block>
  3995. </value>
  3996. <value name="ACTUAL">
  3997. <block type="text_trim" inline="false">
  3998. <field name="MODE">LEFT</field>
  3999. <value name="TEXT">
  4000. <block type="logic_ternary" inline="true">
  4001. <value name="IF">
  4002. <block type="logic_boolean">
  4003. <field name="BOOL">TRUE</field>
  4004. </block>
  4005. </value>
  4006. <value name="THEN">
  4007. <block type="variables_get">
  4008. <field name="VAR">text</field>
  4009. </block>
  4010. </value>
  4011. <value name="ELSE">
  4012. <block type="logic_null"></block>
  4013. </value>
  4014. </block>
  4015. </value>
  4016. </block>
  4017. </value>
  4018. <value name="EXPECTED">
  4019. <block type="text">
  4020. <field name="TEXT">abc def </field>
  4021. </block>
  4022. </value>
  4023. <next>
  4024. <block type="unittest_assertequals" inline="false">
  4025. <value name="MESSAGE">
  4026. <block type="text">
  4027. <field name="TEXT">trim right</field>
  4028. </block>
  4029. </value>
  4030. <value name="ACTUAL">
  4031. <block type="text_trim" inline="false">
  4032. <field name="MODE">RIGHT</field>
  4033. <value name="TEXT">
  4034. <block type="variables_get">
  4035. <field name="VAR">text</field>
  4036. </block>
  4037. </value>
  4038. </block>
  4039. </value>
  4040. <value name="EXPECTED">
  4041. <block type="text">
  4042. <field name="TEXT"> abc def</field>
  4043. </block>
  4044. </value>
  4045. <next>
  4046. <block type="unittest_assertequals" inline="false">
  4047. <value name="MESSAGE">
  4048. <block type="text">
  4049. <field name="TEXT">trim right order</field>
  4050. </block>
  4051. </value>
  4052. <value name="ACTUAL">
  4053. <block type="text_trim" inline="false">
  4054. <field name="MODE">RIGHT</field>
  4055. <value name="TEXT">
  4056. <block type="logic_ternary" inline="true">
  4057. <value name="IF">
  4058. <block type="logic_boolean">
  4059. <field name="BOOL">TRUE</field>
  4060. </block>
  4061. </value>
  4062. <value name="THEN">
  4063. <block type="variables_get">
  4064. <field name="VAR">text</field>
  4065. </block>
  4066. </value>
  4067. <value name="ELSE">
  4068. <block type="logic_null"></block>
  4069. </value>
  4070. </block>
  4071. </value>
  4072. </block>
  4073. </value>
  4074. <value name="EXPECTED">
  4075. <block type="text">
  4076. <field name="TEXT"> abc def</field>
  4077. </block>
  4078. </value>
  4079. </block>
  4080. </next>
  4081. </block>
  4082. </next>
  4083. </block>
  4084. </next>
  4085. </block>
  4086. </next>
  4087. </block>
  4088. </next>
  4089. </block>
  4090. </next>
  4091. </block>
  4092. </statement>
  4093. </block>
  4094. </xml>