logic.xml 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906
  1. <xml xmlns="http://www.w3.org/1999/xhtml">
  2. <block type="unittest_main" x="-4" y="-12">
  3. <statement name="DO">
  4. <block type="unittest_assertvalue" inline="false">
  5. <value name="MESSAGE">
  6. <block type="text">
  7. <field name="TEXT">True</field>
  8. </block>
  9. </value>
  10. <field name="EXPECTED">TRUE</field>
  11. <value name="ACTUAL">
  12. <block type="logic_boolean">
  13. <field name="BOOL">TRUE</field>
  14. </block>
  15. </value>
  16. <next>
  17. <block type="unittest_assertvalue" inline="false">
  18. <value name="MESSAGE">
  19. <block type="text">
  20. <field name="TEXT">False</field>
  21. </block>
  22. </value>
  23. <field name="EXPECTED">FALSE</field>
  24. <value name="ACTUAL">
  25. <block type="logic_boolean">
  26. <field name="BOOL">FALSE</field>
  27. </block>
  28. </value>
  29. <next>
  30. <block type="unittest_assertvalue" inline="false">
  31. <value name="MESSAGE">
  32. <block type="text">
  33. <field name="TEXT">Not true</field>
  34. </block>
  35. </value>
  36. <field name="EXPECTED">TRUE</field>
  37. <value name="ACTUAL">
  38. <block type="logic_negate" inline="false">
  39. <value name="BOOL">
  40. <block type="logic_boolean">
  41. <field name="BOOL">FALSE</field>
  42. </block>
  43. </value>
  44. </block>
  45. </value>
  46. <next>
  47. <block type="unittest_assertvalue" inline="false">
  48. <value name="MESSAGE">
  49. <block type="text">
  50. <field name="TEXT">Not false</field>
  51. </block>
  52. </value>
  53. <field name="EXPECTED">FALSE</field>
  54. <value name="ACTUAL">
  55. <block type="logic_negate" inline="false">
  56. <value name="BOOL">
  57. <block type="logic_boolean">
  58. <field name="BOOL">TRUE</field>
  59. </block>
  60. </value>
  61. </block>
  62. </value>
  63. <next>
  64. <block type="procedures_callnoreturn">
  65. <mutation name="test if"></mutation>
  66. <next>
  67. <block type="procedures_callnoreturn">
  68. <mutation name="test equalities"></mutation>
  69. <next>
  70. <block type="procedures_callnoreturn">
  71. <mutation name="test and"></mutation>
  72. <next>
  73. <block type="procedures_callnoreturn">
  74. <mutation name="test or"></mutation>
  75. <next>
  76. <block type="procedures_callnoreturn">
  77. <mutation name="test ternary"></mutation>
  78. </block>
  79. </next>
  80. </block>
  81. </next>
  82. </block>
  83. </next>
  84. </block>
  85. </next>
  86. </block>
  87. </next>
  88. </block>
  89. </next>
  90. </block>
  91. </next>
  92. </block>
  93. </next>
  94. </block>
  95. </statement>
  96. </block>
  97. <block type="procedures_defnoreturn" x="385" y="-3">
  98. <field name="NAME">test if</field>
  99. <statement name="STACK">
  100. <block type="controls_if" inline="false">
  101. <value name="IF0">
  102. <block type="logic_boolean">
  103. <field name="BOOL">FALSE</field>
  104. </block>
  105. </value>
  106. <statement name="DO0">
  107. <block type="unittest_fail">
  108. <field name="MESSAGE">if false</field>
  109. </block>
  110. </statement>
  111. <next>
  112. <block type="variables_set" inline="false">
  113. <field name="VAR">ok</field>
  114. <value name="VALUE">
  115. <block type="logic_boolean">
  116. <field name="BOOL">FALSE</field>
  117. </block>
  118. </value>
  119. <next>
  120. <block type="controls_if" inline="false">
  121. <value name="IF0">
  122. <block type="logic_boolean">
  123. <field name="BOOL">TRUE</field>
  124. </block>
  125. </value>
  126. <statement name="DO0">
  127. <block type="variables_set" inline="false">
  128. <field name="VAR">ok</field>
  129. <value name="VALUE">
  130. <block type="logic_boolean">
  131. <field name="BOOL">TRUE</field>
  132. </block>
  133. </value>
  134. </block>
  135. </statement>
  136. <next>
  137. <block type="unittest_assertvalue" inline="false">
  138. <value name="MESSAGE">
  139. <block type="text">
  140. <field name="TEXT">if true</field>
  141. </block>
  142. </value>
  143. <field name="EXPECTED">TRUE</field>
  144. <value name="ACTUAL">
  145. <block type="variables_get">
  146. <field name="VAR">ok</field>
  147. </block>
  148. </value>
  149. <next>
  150. <block type="variables_set" inline="false">
  151. <field name="VAR">ok</field>
  152. <value name="VALUE">
  153. <block type="logic_boolean">
  154. <field name="BOOL">FALSE</field>
  155. </block>
  156. </value>
  157. <next>
  158. <block type="controls_if" inline="false">
  159. <mutation else="1"></mutation>
  160. <value name="IF0">
  161. <block type="logic_boolean">
  162. <field name="BOOL">FALSE</field>
  163. </block>
  164. </value>
  165. <statement name="DO0">
  166. <block type="unittest_fail">
  167. <field name="MESSAGE">if/else false</field>
  168. </block>
  169. </statement>
  170. <statement name="ELSE">
  171. <block type="variables_set" inline="false">
  172. <field name="VAR">ok</field>
  173. <value name="VALUE">
  174. <block type="logic_boolean">
  175. <field name="BOOL">TRUE</field>
  176. </block>
  177. </value>
  178. </block>
  179. </statement>
  180. <next>
  181. <block type="unittest_assertvalue" inline="false">
  182. <value name="MESSAGE">
  183. <block type="text">
  184. <field name="TEXT">if/else false</field>
  185. </block>
  186. </value>
  187. <field name="EXPECTED">TRUE</field>
  188. <value name="ACTUAL">
  189. <block type="variables_get">
  190. <field name="VAR">ok</field>
  191. </block>
  192. </value>
  193. <next>
  194. <block type="variables_set" inline="false">
  195. <field name="VAR">ok</field>
  196. <value name="VALUE">
  197. <block type="logic_boolean">
  198. <field name="BOOL">FALSE</field>
  199. </block>
  200. </value>
  201. <next>
  202. <block type="controls_if" inline="false">
  203. <mutation else="1"></mutation>
  204. <value name="IF0">
  205. <block type="logic_boolean">
  206. <field name="BOOL">TRUE</field>
  207. </block>
  208. </value>
  209. <statement name="DO0">
  210. <block type="variables_set" inline="false">
  211. <field name="VAR">ok</field>
  212. <value name="VALUE">
  213. <block type="logic_boolean">
  214. <field name="BOOL">TRUE</field>
  215. </block>
  216. </value>
  217. </block>
  218. </statement>
  219. <statement name="ELSE">
  220. <block type="unittest_fail">
  221. <field name="MESSAGE">if/else true</field>
  222. </block>
  223. </statement>
  224. <next>
  225. <block type="unittest_assertvalue" inline="false">
  226. <value name="MESSAGE">
  227. <block type="text">
  228. <field name="TEXT">if/else true</field>
  229. </block>
  230. </value>
  231. <field name="EXPECTED">TRUE</field>
  232. <value name="ACTUAL">
  233. <block type="variables_get">
  234. <field name="VAR">ok</field>
  235. </block>
  236. </value>
  237. <next>
  238. <block type="variables_set" inline="false">
  239. <field name="VAR">ok</field>
  240. <value name="VALUE">
  241. <block type="logic_boolean">
  242. <field name="BOOL">FALSE</field>
  243. </block>
  244. </value>
  245. <next>
  246. <block type="controls_if" inline="false">
  247. <mutation elseif="2" else="1"></mutation>
  248. <value name="IF0">
  249. <block type="logic_boolean">
  250. <field name="BOOL">FALSE</field>
  251. </block>
  252. </value>
  253. <statement name="DO0">
  254. <block type="unittest_fail">
  255. <field name="MESSAGE">elseif 1</field>
  256. </block>
  257. </statement>
  258. <value name="IF1">
  259. <block type="logic_boolean">
  260. <field name="BOOL">TRUE</field>
  261. </block>
  262. </value>
  263. <statement name="DO1">
  264. <block type="variables_set" inline="false">
  265. <field name="VAR">ok</field>
  266. <value name="VALUE">
  267. <block type="logic_boolean">
  268. <field name="BOOL">TRUE</field>
  269. </block>
  270. </value>
  271. </block>
  272. </statement>
  273. <value name="IF2">
  274. <block type="logic_boolean">
  275. <field name="BOOL">TRUE</field>
  276. </block>
  277. </value>
  278. <statement name="DO2">
  279. <block type="unittest_fail">
  280. <field name="MESSAGE">elseif 2</field>
  281. </block>
  282. </statement>
  283. <statement name="ELSE">
  284. <block type="unittest_fail">
  285. <field name="MESSAGE">elseif 3</field>
  286. </block>
  287. </statement>
  288. <next>
  289. <block type="unittest_assertvalue" inline="false">
  290. <value name="MESSAGE">
  291. <block type="text">
  292. <field name="TEXT">elseif 4</field>
  293. </block>
  294. </value>
  295. <field name="EXPECTED">TRUE</field>
  296. <value name="ACTUAL">
  297. <block type="variables_get">
  298. <field name="VAR">ok</field>
  299. </block>
  300. </value>
  301. </block>
  302. </next>
  303. </block>
  304. </next>
  305. </block>
  306. </next>
  307. </block>
  308. </next>
  309. </block>
  310. </next>
  311. </block>
  312. </next>
  313. </block>
  314. </next>
  315. </block>
  316. </next>
  317. </block>
  318. </next>
  319. </block>
  320. </next>
  321. </block>
  322. </next>
  323. </block>
  324. </next>
  325. </block>
  326. </statement>
  327. </block>
  328. <block type="procedures_defnoreturn" x="-7" y="384">
  329. <field name="NAME">test equalities</field>
  330. <statement name="STACK">
  331. <block type="unittest_assertvalue" inline="false">
  332. <value name="MESSAGE">
  333. <block type="text">
  334. <field name="TEXT">Equal yes</field>
  335. </block>
  336. </value>
  337. <field name="EXPECTED">TRUE</field>
  338. <value name="ACTUAL">
  339. <block type="logic_compare">
  340. <field name="OP">EQ</field>
  341. <value name="A">
  342. <block type="math_number">
  343. <field name="NUM">2</field>
  344. </block>
  345. </value>
  346. <value name="B">
  347. <block type="math_number">
  348. <field name="NUM">2</field>
  349. </block>
  350. </value>
  351. </block>
  352. </value>
  353. <next>
  354. <block type="unittest_assertvalue" inline="false">
  355. <value name="MESSAGE">
  356. <block type="text">
  357. <field name="TEXT">Equal no</field>
  358. </block>
  359. </value>
  360. <field name="EXPECTED">FALSE</field>
  361. <value name="ACTUAL">
  362. <block type="logic_compare">
  363. <field name="OP">EQ</field>
  364. <value name="A">
  365. <block type="math_number">
  366. <field name="NUM">3</field>
  367. </block>
  368. </value>
  369. <value name="B">
  370. <block type="math_number">
  371. <field name="NUM">4</field>
  372. </block>
  373. </value>
  374. </block>
  375. </value>
  376. <next>
  377. <block type="unittest_assertvalue" inline="false">
  378. <value name="MESSAGE">
  379. <block type="text">
  380. <field name="TEXT">Not equal yes</field>
  381. </block>
  382. </value>
  383. <field name="EXPECTED">TRUE</field>
  384. <value name="ACTUAL">
  385. <block type="logic_compare">
  386. <field name="OP">NEQ</field>
  387. <value name="A">
  388. <block type="math_number">
  389. <field name="NUM">5</field>
  390. </block>
  391. </value>
  392. <value name="B">
  393. <block type="math_number">
  394. <field name="NUM">6</field>
  395. </block>
  396. </value>
  397. </block>
  398. </value>
  399. <next>
  400. <block type="unittest_assertvalue" inline="false">
  401. <value name="MESSAGE">
  402. <block type="text">
  403. <field name="TEXT">Not equal no</field>
  404. </block>
  405. </value>
  406. <field name="EXPECTED">FALSE</field>
  407. <value name="ACTUAL">
  408. <block type="logic_compare">
  409. <field name="OP">EQ</field>
  410. <value name="A">
  411. <block type="math_number">
  412. <field name="NUM">3</field>
  413. </block>
  414. </value>
  415. <value name="B">
  416. <block type="math_number">
  417. <field name="NUM">4</field>
  418. </block>
  419. </value>
  420. </block>
  421. </value>
  422. <next>
  423. <block type="unittest_assertvalue" inline="false">
  424. <value name="MESSAGE">
  425. <block type="text">
  426. <field name="TEXT">Smaller yes</field>
  427. </block>
  428. </value>
  429. <field name="EXPECTED">TRUE</field>
  430. <value name="ACTUAL">
  431. <block type="logic_compare">
  432. <field name="OP">LT</field>
  433. <value name="A">
  434. <block type="math_number">
  435. <field name="NUM">5</field>
  436. </block>
  437. </value>
  438. <value name="B">
  439. <block type="math_number">
  440. <field name="NUM">6</field>
  441. </block>
  442. </value>
  443. </block>
  444. </value>
  445. <next>
  446. <block type="unittest_assertvalue" inline="false">
  447. <value name="MESSAGE">
  448. <block type="text">
  449. <field name="TEXT">Smaller no</field>
  450. </block>
  451. </value>
  452. <field name="EXPECTED">FALSE</field>
  453. <value name="ACTUAL">
  454. <block type="logic_compare">
  455. <field name="OP">LT</field>
  456. <value name="A">
  457. <block type="math_number">
  458. <field name="NUM">7</field>
  459. </block>
  460. </value>
  461. <value name="B">
  462. <block type="math_number">
  463. <field name="NUM">7</field>
  464. </block>
  465. </value>
  466. </block>
  467. </value>
  468. <next>
  469. <block type="unittest_assertvalue" inline="false">
  470. <value name="MESSAGE">
  471. <block type="text">
  472. <field name="TEXT">Greater yes</field>
  473. </block>
  474. </value>
  475. <field name="EXPECTED">TRUE</field>
  476. <value name="ACTUAL">
  477. <block type="logic_compare">
  478. <field name="OP">GT</field>
  479. <value name="A">
  480. <block type="math_number">
  481. <field name="NUM">9</field>
  482. </block>
  483. </value>
  484. <value name="B">
  485. <block type="math_number">
  486. <field name="NUM">8</field>
  487. </block>
  488. </value>
  489. </block>
  490. </value>
  491. <next>
  492. <block type="unittest_assertvalue" inline="false">
  493. <value name="MESSAGE">
  494. <block type="text">
  495. <field name="TEXT">Greater no</field>
  496. </block>
  497. </value>
  498. <field name="EXPECTED">FALSE</field>
  499. <value name="ACTUAL">
  500. <block type="logic_compare">
  501. <field name="OP">GT</field>
  502. <value name="A">
  503. <block type="math_number">
  504. <field name="NUM">10</field>
  505. </block>
  506. </value>
  507. <value name="B">
  508. <block type="math_number">
  509. <field name="NUM">10</field>
  510. </block>
  511. </value>
  512. </block>
  513. </value>
  514. <next>
  515. <block type="unittest_assertvalue" inline="false">
  516. <value name="MESSAGE">
  517. <block type="text">
  518. <field name="TEXT">Smaller-equal yes</field>
  519. </block>
  520. </value>
  521. <field name="EXPECTED">TRUE</field>
  522. <value name="ACTUAL">
  523. <block type="logic_compare">
  524. <field name="OP">LTE</field>
  525. <value name="A">
  526. <block type="math_number">
  527. <field name="NUM">11</field>
  528. </block>
  529. </value>
  530. <value name="B">
  531. <block type="math_number">
  532. <field name="NUM">11</field>
  533. </block>
  534. </value>
  535. </block>
  536. </value>
  537. <next>
  538. <block type="unittest_assertvalue" inline="false">
  539. <value name="MESSAGE">
  540. <block type="text">
  541. <field name="TEXT">Smaller-equal no</field>
  542. </block>
  543. </value>
  544. <field name="EXPECTED">FALSE</field>
  545. <value name="ACTUAL">
  546. <block type="logic_compare">
  547. <field name="OP">LTE</field>
  548. <value name="A">
  549. <block type="math_number">
  550. <field name="NUM">13</field>
  551. </block>
  552. </value>
  553. <value name="B">
  554. <block type="math_number">
  555. <field name="NUM">12</field>
  556. </block>
  557. </value>
  558. </block>
  559. </value>
  560. <next>
  561. <block type="unittest_assertvalue" inline="false">
  562. <value name="MESSAGE">
  563. <block type="text">
  564. <field name="TEXT">Greater-equal yes</field>
  565. </block>
  566. </value>
  567. <field name="EXPECTED">TRUE</field>
  568. <value name="ACTUAL">
  569. <block type="logic_compare">
  570. <field name="OP">GTE</field>
  571. <value name="A">
  572. <block type="math_number">
  573. <field name="NUM">14</field>
  574. </block>
  575. </value>
  576. <value name="B">
  577. <block type="math_number">
  578. <field name="NUM">14</field>
  579. </block>
  580. </value>
  581. </block>
  582. </value>
  583. <next>
  584. <block type="unittest_assertvalue" inline="false">
  585. <value name="MESSAGE">
  586. <block type="text">
  587. <field name="TEXT">Greater-equal no</field>
  588. </block>
  589. </value>
  590. <field name="EXPECTED">FALSE</field>
  591. <value name="ACTUAL">
  592. <block type="logic_compare">
  593. <field name="OP">GTE</field>
  594. <value name="A">
  595. <block type="math_number">
  596. <field name="NUM">15</field>
  597. </block>
  598. </value>
  599. <value name="B">
  600. <block type="math_number">
  601. <field name="NUM">16</field>
  602. </block>
  603. </value>
  604. </block>
  605. </value>
  606. </block>
  607. </next>
  608. </block>
  609. </next>
  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. </next>
  628. </block>
  629. </statement>
  630. </block>
  631. <block type="procedures_defnoreturn" x="-5" y="1200">
  632. <field name="NAME">test or</field>
  633. <statement name="STACK">
  634. <block type="unittest_assertvalue" inline="false">
  635. <value name="MESSAGE">
  636. <block type="text">
  637. <field name="TEXT">Or true/true</field>
  638. </block>
  639. </value>
  640. <field name="EXPECTED">TRUE</field>
  641. <value name="ACTUAL">
  642. <block type="logic_operation">
  643. <field name="OP">OR</field>
  644. <value name="A">
  645. <block type="logic_boolean">
  646. <field name="BOOL">TRUE</field>
  647. </block>
  648. </value>
  649. <value name="B">
  650. <block type="logic_boolean">
  651. <field name="BOOL">TRUE</field>
  652. </block>
  653. </value>
  654. </block>
  655. </value>
  656. <next>
  657. <block type="unittest_assertvalue" inline="false">
  658. <value name="MESSAGE">
  659. <block type="text">
  660. <field name="TEXT">Or false/true</field>
  661. </block>
  662. </value>
  663. <field name="EXPECTED">TRUE</field>
  664. <value name="ACTUAL">
  665. <block type="logic_operation">
  666. <field name="OP">OR</field>
  667. <value name="A">
  668. <block type="logic_boolean">
  669. <field name="BOOL">FALSE</field>
  670. </block>
  671. </value>
  672. <value name="B">
  673. <block type="logic_boolean">
  674. <field name="BOOL">TRUE</field>
  675. </block>
  676. </value>
  677. </block>
  678. </value>
  679. <next>
  680. <block type="unittest_assertvalue" inline="false">
  681. <value name="MESSAGE">
  682. <block type="text">
  683. <field name="TEXT">Or true/false</field>
  684. </block>
  685. </value>
  686. <field name="EXPECTED">TRUE</field>
  687. <value name="ACTUAL">
  688. <block type="logic_operation">
  689. <field name="OP">OR</field>
  690. <value name="A">
  691. <block type="logic_boolean">
  692. <field name="BOOL">TRUE</field>
  693. </block>
  694. </value>
  695. <value name="B">
  696. <block type="logic_boolean">
  697. <field name="BOOL">FALSE</field>
  698. </block>
  699. </value>
  700. </block>
  701. </value>
  702. <next>
  703. <block type="unittest_assertvalue" inline="false">
  704. <value name="MESSAGE">
  705. <block type="text">
  706. <field name="TEXT">Or false/false</field>
  707. </block>
  708. </value>
  709. <field name="EXPECTED">FALSE</field>
  710. <value name="ACTUAL">
  711. <block type="logic_operation">
  712. <field name="OP">OR</field>
  713. <value name="A">
  714. <block type="logic_boolean">
  715. <field name="BOOL">FALSE</field>
  716. </block>
  717. </value>
  718. <value name="B">
  719. <block type="logic_boolean">
  720. <field name="BOOL">FALSE</field>
  721. </block>
  722. </value>
  723. </block>
  724. </value>
  725. </block>
  726. </next>
  727. </block>
  728. </next>
  729. </block>
  730. </next>
  731. </block>
  732. </statement>
  733. </block>
  734. <block type="procedures_defnoreturn" x="385" y="1208">
  735. <field name="NAME">test and</field>
  736. <statement name="STACK">
  737. <block type="unittest_assertvalue" inline="false">
  738. <value name="MESSAGE">
  739. <block type="text">
  740. <field name="TEXT">And true/true</field>
  741. </block>
  742. </value>
  743. <field name="EXPECTED">TRUE</field>
  744. <value name="ACTUAL">
  745. <block type="logic_operation">
  746. <field name="OP">AND</field>
  747. <value name="A">
  748. <block type="logic_boolean">
  749. <field name="BOOL">TRUE</field>
  750. </block>
  751. </value>
  752. <value name="B">
  753. <block type="logic_boolean">
  754. <field name="BOOL">TRUE</field>
  755. </block>
  756. </value>
  757. </block>
  758. </value>
  759. <next>
  760. <block type="unittest_assertvalue" inline="false">
  761. <value name="MESSAGE">
  762. <block type="text">
  763. <field name="TEXT">And false/true</field>
  764. </block>
  765. </value>
  766. <field name="EXPECTED">FALSE</field>
  767. <value name="ACTUAL">
  768. <block type="logic_operation">
  769. <field name="OP">AND</field>
  770. <value name="A">
  771. <block type="logic_boolean">
  772. <field name="BOOL">FALSE</field>
  773. </block>
  774. </value>
  775. <value name="B">
  776. <block type="logic_boolean">
  777. <field name="BOOL">TRUE</field>
  778. </block>
  779. </value>
  780. </block>
  781. </value>
  782. <next>
  783. <block type="unittest_assertvalue" inline="false">
  784. <value name="MESSAGE">
  785. <block type="text">
  786. <field name="TEXT">And true/false</field>
  787. </block>
  788. </value>
  789. <field name="EXPECTED">FALSE</field>
  790. <value name="ACTUAL">
  791. <block type="logic_operation">
  792. <field name="OP">AND</field>
  793. <value name="A">
  794. <block type="logic_boolean">
  795. <field name="BOOL">TRUE</field>
  796. </block>
  797. </value>
  798. <value name="B">
  799. <block type="logic_boolean">
  800. <field name="BOOL">FALSE</field>
  801. </block>
  802. </value>
  803. </block>
  804. </value>
  805. <next>
  806. <block type="unittest_assertvalue" inline="false">
  807. <value name="MESSAGE">
  808. <block type="text">
  809. <field name="TEXT">And false/false</field>
  810. </block>
  811. </value>
  812. <field name="EXPECTED">FALSE</field>
  813. <value name="ACTUAL">
  814. <block type="logic_operation">
  815. <field name="OP">AND</field>
  816. <value name="A">
  817. <block type="logic_boolean">
  818. <field name="BOOL">FALSE</field>
  819. </block>
  820. </value>
  821. <value name="B">
  822. <block type="logic_boolean">
  823. <field name="BOOL">FALSE</field>
  824. </block>
  825. </value>
  826. </block>
  827. </value>
  828. </block>
  829. </next>
  830. </block>
  831. </next>
  832. </block>
  833. </next>
  834. </block>
  835. </statement>
  836. </block>
  837. <block type="procedures_defnoreturn" x="3" y="1527">
  838. <field name="NAME">test ternary</field>
  839. <statement name="STACK">
  840. <block type="unittest_assertequals" inline="false">
  841. <value name="MESSAGE">
  842. <block type="text">
  843. <field name="TEXT">if true</field>
  844. </block>
  845. </value>
  846. <value name="ACTUAL">
  847. <block type="logic_ternary" inline="true">
  848. <value name="IF">
  849. <block type="logic_boolean">
  850. <field name="BOOL">TRUE</field>
  851. </block>
  852. </value>
  853. <value name="THEN">
  854. <block type="math_number">
  855. <field name="NUM">42</field>
  856. </block>
  857. </value>
  858. <value name="ELSE">
  859. <block type="math_number">
  860. <field name="NUM">99</field>
  861. </block>
  862. </value>
  863. </block>
  864. </value>
  865. <value name="EXPECTED">
  866. <block type="math_number">
  867. <field name="NUM">42</field>
  868. </block>
  869. </value>
  870. <next>
  871. <block type="unittest_assertequals" inline="false">
  872. <value name="MESSAGE">
  873. <block type="text">
  874. <field name="TEXT">if true</field>
  875. </block>
  876. </value>
  877. <value name="ACTUAL">
  878. <block type="logic_ternary" inline="true">
  879. <value name="IF">
  880. <block type="logic_boolean">
  881. <field name="BOOL">FALSE</field>
  882. </block>
  883. </value>
  884. <value name="THEN">
  885. <block type="math_number">
  886. <field name="NUM">42</field>
  887. </block>
  888. </value>
  889. <value name="ELSE">
  890. <block type="math_number">
  891. <field name="NUM">99</field>
  892. </block>
  893. </value>
  894. </block>
  895. </value>
  896. <value name="EXPECTED">
  897. <block type="math_number">
  898. <field name="NUM">99</field>
  899. </block>
  900. </value>
  901. </block>
  902. </next>
  903. </block>
  904. </statement>
  905. </block>
  906. </xml>