mirror of
https://github.com/google/blockly.git
synced 2026-01-08 09:30:06 +01:00
* Add indexing setting for JavaScript Generation Adding setting to allow for switching between zero and one based indexing for Blockly Blocks such that the generated code will use this flag to determine whether one based or zero based indexing should be used. One based indexing is enabled by default. * Updating js lists to do zero and one based index Updated generated JavaScript to change depending on whether one based indexing is enabled or not. * Updating js text to do zero and one based index Change so that JavaScript generated for text blocks either assumes blocks use zero or one based index based on setting. * Start of python indexing Start of work on allowing one and zero indexing for generated python for lists. * Fixing bug and lint fixed Fixing bug caused by not setting the return of concat when concatenating lines for sublist and substring functions. Also renamed these functions to be getSubsequece. Fixed lint errors with spacing * Converting from if to switch statements Comverting if statements to switch statements when appropriate and adding spacing. * Modified sublist JavaScript generation Added case so that helper function is not generated if not necessary. Helper function is not generated if list length is not needed or if list is a simple block (such as a variable, as oppossed to a function call or list create). * Stripping unecessary ids Removing ids from xml file. * Localisation updates from https://translatewiki.net. * Fix typo in flyout.js (#403) * Fix typo in flyout.js (#402) * Localisation updates from https://translatewiki.net. * Add indexing setting for JavaScript Generation Adding setting to allow for switching between zero and one based indexing for Blockly Blocks such that the generated code will use this flag to determine whether one based or zero based indexing should be used. One based indexing is enabled by default. * Updating js lists to do zero and one based index Updated generated JavaScript to change depending on whether one based indexing is enabled or not. * Updating js text to do zero and one based index Change so that JavaScript generated for text blocks either assumes blocks use zero or one based index based on setting. * Fixing bug and lint fixed Fixing bug caused by not setting the return of concat when concatenating lines for sublist and substring functions. Also renamed these functions to be getSubsequece. Fixed lint errors with spacing * Converting from if to switch statements Comverting if statements to switch statements when appropriate and adding spacing. * Modified sublist JavaScript generation Added case so that helper function is not generated if not necessary. Helper function is not generated if list length is not needed or if list is a simple block (such as a variable, as oppossed to a function call or list create). * Stripping unecessary ids Removing ids from xml file. * Updating generator test Modifying sublist test and re-formatting spacing between blocks. * Updating js lists to do zero and one based index Updated generated JavaScript to change depending on whether one based indexing is enabled or not. * Updating js text to do zero and one based index Change so that JavaScript generated for text blocks either assumes blocks use zero or one based index based on setting. * Fixing bug and lint fixed Fixing bug caused by not setting the return of concat when concatenating lines for sublist and substring functions. Also renamed these functions to be getSubsequece. Fixed lint errors with spacing * Converting from if to switch statements Comverting if statements to switch statements when appropriate and adding spacing. * Modified sublist JavaScript generation Added case so that helper function is not generated if not necessary. Helper function is not generated if list length is not needed or if list is a simple block (such as a variable, as oppossed to a function call or list create). * Stripping unecessary ids Removing ids from xml file. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Updating js lists to do zero and one based index Updated generated JavaScript to change depending on whether one based indexing is enabled or not. * Fixing bug and lint fixed Fixing bug caused by not setting the return of concat when concatenating lines for sublist and substring functions. Also renamed these functions to be getSubsequece. Fixed lint errors with spacing * Modified sublist JavaScript generation Added case so that helper function is not generated if not necessary. Helper function is not generated if list length is not needed or if list is a simple block (such as a variable, as oppossed to a function call or list create). * Stripping unecessary ids Removing ids from xml file. * Updating generator test Modifying sublist test and re-formatting spacing between blocks. * Adding tests for indexing and extra cases Adding tests for indexing with custom block to adjust number based on what indexing is being generated. * Adding tests and renaming tests Adding tests for sublist and renaming tests. * Fixes for order for sublists Fixes so that parenthesis are generated properly for index for sublist * Cleaning up test generated code Changing order returned for unit test adjust index function to generate less unecessary parenthesis. * Adding tests for order Adding tests for order, relevant for methods that use index from start (because 1 is added) * Fixing JS order for getIndex and setIndex Changing to the correct order type when calling valueToCode in JS generation for getIndex and setIndex. * Fixed unittest adjustIndex Fixed uninttest adjustindex to also check whether the ONE_BASED_INDEXING variable has been defined to ensure proper behaviour. * Fixing lint and formatting for JS/lists Making line fixes and changing an if/elseif to case statement. * Tests added to include case for bug found Added tests with sublist combinations of different where's for the two indices after bug for this found in python. * Adding and renaming tests Adding test case for creating a sublist that encompasses the whole list but uses # and #-end instead of first last (applicable for python). Also, renaming tests. * Adding contant and fixing python lists bugs Adding contant for ONE_BASED_INDEXING and fixing bugs in python for lists. * Fixing test get random Fixing test get random to take into account indexing for return value. * Adding indexing checkbox to test page Adding checkbos on test page so that code can be generated for one and zero based indexing. Languages that are generated with zero based indexing that do not have it implemented will fail tests as expected. * Fixing unittest getremove random Fixing unittest getremove random to take into account the return value based on indexing. * Change comparison for getremove random test Fixed comparison to equal for the return value for getremove random. * Fixing bugs with lists zero-indexing Fixing getIndex and getSublist methods to pass for zero-indexed tests. * Adding test cases and formatting Adding test cases to text tests, reordering a couple list test, and formatting block spacing. * Fixing unittest expected value Fixing expected value fore unit tests for sublist. * Cleanup Removing obvious comments, formatting fixes, and naming in generated code in JS. * Helper function for Python lists Adding helper function for casting to int for indices. * Expanding helper to reduce duplicated code Expanding helper method to also get the property with the correct order and check indexing to reduce duplicated code. * Cleaning up JS indexing with helper function Adding helper function for indexing and used it in lists and text. * Moving helper function and formatting fixes Moving helper function, formatting fixes, and changing some generated code variable names. * Fixing python generation for text Fixing all failinng tests for python and using new helper method. * Lint fixes and order in indexOf Making lint fixes and correcting returned order in indexOf. * Python variable renaming Renaming a few generated variables. * Fixing comment and order Fixing comment to list Blockly.Block type and fixing order because it could be higher. * Switching back to if Switching switch back to if statements because there weren't enough cases to warrant for a switch. * Adding order and fixing lists for Dart Adding if null operator to operator precedence for Dart. Also, fixing lists implementation to pass unit tests and adding zero-indexing functionality. * Formatting and lint fixes Formatting and lint fixes * Dart text fixed Fixing Dart text generation to pass unit tests. * Changing back to variable Changing switch condition back to variable. * Fixing ORDER_OVERRIDES Inner and outer order was switched . * Adding bug with order caused by generator change Flooring order before comparision because of how the order constants were modified. * Adding list tests Adding tests for additional cases for lists/ * Adding comment for dart order Adding comment for Dart ORDER_IF_NULL operator. * Formatting fixes Formatting fixes for line indentation. * Fixing PHP order and lists generation Fixing PHP order constants and fixing lists so that they pass unit tests. * Fixing tests Removing duplicate unit test * Adding text tests Adding tests for text. * Renaming variable and removing unused variable Renaming variables from exceptionIndex to errorIndex and removing unused at variable. * Adding missing function call to test Adding missing funciton call to test that was causing tests to fail when they shouldn't. * Fixing PHP text generation Fixing PHP text code generation so it passes unit tests. * Formatting fixes Cleaning up code, renamiing a variable. * Fixing failing subsequence tests Fixing JS code that failed for sublist/substring tests. * Fixing intentation Fixing indentation. * Fixing Dart sublist/substring Fixing sublist/substring to include condiiton where FROM_START (and not throw error by mistake) when zero-indexed. * Adding order subtraction test Adding test for checking order for subtraction x- (y - z) x - (y + z). * Updating to new PHP power operator Updating from pow function to ** operator to clean up code. * Updating to new removeWhere Updating removeMatching to removeWhere because new version of Dart now use removeWhere. * Fix for lua rounding assertequals Adding check for number in equlity check for comparing number for floats. * Adding test for copy of list Adding test that checks the list is copied when a sublist is made first-last. * Formatting and order fixes Fixing formatting such as indentation and order fixes. * Adding comment for clarity Adding comment about how Lua code generation is not supporting zero indexing. * Changed variable names in code Changed variable names to follow style guide and changed for loop variable from n to i as is typical. * Reducing unecessarily generated functions and renaming variables Reducing number of generated functions using gensym_ by adding parameters to provided function. Renaming variables to make functions more readble. * Fixing sublist order and sort variable Fixing order used for valueToCode for sublist and renaming list variable in sort to match rest of code.. * Fixing order constant order Removing operator () that was incorrect and addiung ~, * Fixing order and indentation Fixing order return fro create lists blocks and fixing indentationn for string array. * Fixing order and renaming variables Fixing order to be the correct strength and renaming variables to be more readable/ * Changing assert blocks for unit tests Changing assert blocks to have a value input instead of a field so there is more flexibility in writing tests. * Cleaning up and adding missing order tests Adding tests for order for paramters for list blocks that weren't being tested to uncover bugs. Test were also cleaned up/reorganized/renamed to be more readable and shorter vertically (but lines wider horizontally). * Compile error fix and order in Dart generation. Fixing compile error in generated code and incorrect order in get sublist for Dart. * Fixing typo in getIndex and invalid parameter name Fixing type in getIndex where list code should have been appended but instead an undefined variable was added. The parameter in lists_sort was changed to my_list because list is a reserved word in python. * Fixing order, parenthesis bug, and variable declaration in Lua Fixing incorrect order in Lua. Fixing bug caused by missing parenthesis around ternary operator in code. Variable code was declared with JavaScript syntax, this was fixed to be valid in Lua. * Adding tests and formatting tests Adding missing test for order in text/lists. Changing spacing/order of tests and updating comments. * Fixing error in code Changing to correct function call in empy tests and changing test name that was duplicated to be more clear. * Renamed test helper function * Fixing order and renaming variable in JS generator Fixing order for charAt and renaming variable in code list_sort from listCode to list to be consistent with rest of code. * Fixing order for dart text Fixing roder for dart charAt * Cleaning up generated code for Dart getIndex Cleaning up generated code for Dart getIndex so that helper functions aren't generated unecessarily and adding comments. * Fixing Dart remove random error Fixing error caused by remove random implementation in Dart. index should have been x but instead was length - x. * Fixing unit test blocks Fixing Lua unit test block that should have just returned the number and removing unecessary checks in other blocks because the constant was defined. * Fixing Lua assert equals block string.format was throwing an error if one of the values happened to be a boolean. * Adding tests for create text with number Adding test for create text with numbers as parameters * Fixing lua unit test block Lua unit test block should have added 1 * Removing indexing setting for Lua tests Removing setting index setting for Lua generation because it is always one-indexed. * Fixing order and create text Fixing failing test caused by improper order and fixed create text to properly convert to string when there is one element. * Running linter on generator code Running linter on generator code and fixing spacing/indentation problems. * Editing comments and removing uneeded parenthesis Editing and adding comments and removing uneeded parenthesis around ternary operator condition. * Fixing order and changing variable names Fixing orders that were incorrect and changing variable names to be more descriptive and consistent across code. * Adding comment about list support and fixes for PHP Adding comment about how lists are not fully supported for PHP. Adding missing order to PHP and fixing order errors throughout. Fixing regex for variable matching in lists. Cleaning up variable names to be more readable and consistent with other parts of code. * Reducing complexity for getremove/remove in JS Reducing complexity in generated code for getremove/remove in JavaScript by replacing unecessary helper function. * Fixing spacing before inline comments Ensuring there are two spaces before inline comments. * Changing JS list copy for clarity Changing JavaScript list copy to use slice(0) instead of concat for clarity and to use the same pattern as the other sublist methods. * Changing generated variable name tmp_x Changing tmp_x to tmpX to follow closer to the correct style for JavaScript. * Prefixing empy lines between comment text Prior to this change, comments with an empty line between text did not have a comment prefix before it, resulting in comment blocks that seemed disjoined although they were for the same block. This change affects how the prefix line function works so that those lines will have the prefix (if applicable) while still taking into account the trailing newline character. * Changing for loops variable names Changing most for loops to use i as the variable name (or j if applicable) or changing name to be more readable. * Simplifying provided subsequence function Simplifying subsequence function to generate a simpler function depending on where combination instead of a larger complex function that works for all where combinations. * Style fixes Fixing indentation, comments, and other formatting-type changes based on pull request comments. * Fixing indentation Fixing indentation and removing an extra newline. * Fixing PHP mode implementation Fixing PHP mode implementation to properlyu return multiple modes if applicable. * Fixing line too long Wrapping lines in php/math.js with lines longer than 80 characters. * Wrapping long lines Wrapping lines that are too long. * Changing boolean casing Changing boolean casing to be lowercase.
8134 lines
645 KiB
XML
8134 lines
645 KiB
XML
<xml xmlns="http://www.w3.org/1999/xhtml">
|
|
<block type="unittest_main" x="13" y="13">
|
|
<statement name="DO">
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test create"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test empty"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test length"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test find simple"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test find complex"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test get simple"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test get complex"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test getRemove"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test remove"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test set"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test insert"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test sublist simple"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test sublist complex"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test join"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test split"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test sort alphabetic"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test sort ignoreCase"></mutation>
|
|
<next>
|
|
<block type="procedures_callnoreturn">
|
|
<mutation name="test sort numeric"></mutation>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="538">
|
|
<mutation>
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<field name="NAME">check number of calls</field>
|
|
<comment pinned="false" h="78" w="257">Checks that the number of calls is one in order to confirm that a function was only called once.</comment>
|
|
<statement name="STACK">
|
|
<block type="text_append">
|
|
<field name="VAR">test name</field>
|
|
<value name="TEXT">
|
|
<block type="text">
|
|
<field name="TEXT">number of calls</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="variables_get">
|
|
<field name="VAR">test name</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">number of calls</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="713">
|
|
<field name="NAME">test create</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "create list with" and "create empty list" blocks.</comment>
|
|
<statement name="STACK">
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">create empty</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_create_with">
|
|
<mutation items="0"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_empty"></block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">create items</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">love</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">love</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">create repeated</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_repeat" inline="true">
|
|
<value name="ITEM">
|
|
<block type="text">
|
|
<field name="TEXT">Eject</field>
|
|
</block>
|
|
</value>
|
|
<value name="NUM">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Eject</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Eject</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Eject</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">create repeated order</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_repeat" inline="true">
|
|
<value name="ITEM">
|
|
<block type="text">
|
|
<field name="TEXT">Eject</field>
|
|
</block>
|
|
</value>
|
|
<value name="NUM">
|
|
<block type="math_arithmetic">
|
|
<field name="OP">ADD</field>
|
|
<value name="A">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Eject</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Eject</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Eject</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defreturn" x="13" y="1163">
|
|
<mutation statements="false"></mutation>
|
|
<field name="NAME">get empty list</field>
|
|
<comment pinned="false" h="80" w="160">Creates an empty list for use with the empty test.</comment>
|
|
<value name="RETURN">
|
|
<block type="lists_create_empty"></block>
|
|
</value>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="1238">
|
|
<field name="NAME">test empty</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "is empty" block.</comment>
|
|
<statement name="STACK">
|
|
<block type="unittest_assertvalue" inline="false">
|
|
<field name="EXPECTED">FALSE</field>
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">not empty</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_isEmpty" inline="true">
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="false">
|
|
<mutation items="1"></mutation>
|
|
<value name="ADD0">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertvalue" inline="false">
|
|
<field name="EXPECTED">TRUE</field>
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">empty</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_isEmpty" inline="true">
|
|
<value name="VALUE">
|
|
<block type="lists_create_empty"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertvalue" inline="false">
|
|
<field name="EXPECTED">TRUE</field>
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">empty complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_isEmpty" inline="true">
|
|
<value name="VALUE">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get empty list"></mutation>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertvalue" inline="false">
|
|
<field name="EXPECTED">TRUE</field>
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">empty order</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_isEmpty" inline="true">
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="lists_create_empty"></block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="1563">
|
|
<field name="NAME">test length</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "length" block.</comment>
|
|
<statement name="STACK">
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">zero length</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_length" inline="false">
|
|
<value name="VALUE">
|
|
<block type="lists_create_empty"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">one length</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_length" inline="false">
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="false">
|
|
<mutation items="1"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">cat</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">three length</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_length" inline="false">
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">cat</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="lists_create_empty"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">two length order</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_length" inline="false">
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="lists_create_with" inline="false">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">cat</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="1988">
|
|
<field name="NAME">test find simple</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "find" block with a variable.</comment>
|
|
<statement name="STACK">
|
|
<block type="variables_set">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="4"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Alice</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Eve</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Bob</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Eve</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">find first simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_indexOf" inline="false">
|
|
<field name="END">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="FIND">
|
|
<block type="text">
|
|
<field name="TEXT">Eve</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">find last simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_indexOf" inline="false">
|
|
<field name="END">LAST</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="FIND">
|
|
<block type="text">
|
|
<field name="TEXT">Eve</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">find none simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_indexOf" inline="false">
|
|
<field name="END">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="FIND">
|
|
<block type="text">
|
|
<field name="TEXT">Dave</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">-1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defreturn" x="13" y="2438">
|
|
<field name="NAME">get names</field>
|
|
<comment pinned="false" h="80" w="160">Creates a list for use with the find test.</comment>
|
|
<statement name="STACK">
|
|
<block type="math_change">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="DELTA">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</statement>
|
|
<value name="RETURN">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="4"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Alice</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Eve</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Bob</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Eve</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="2563">
|
|
<field name="NAME">test find complex</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "find" block with a function call.</comment>
|
|
<statement name="STACK">
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">find first complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_indexOf" inline="false">
|
|
<field name="END">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get names"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="FIND">
|
|
<block type="text">
|
|
<field name="TEXT">Eve</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">find first complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">find first order complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_indexOf" inline="false">
|
|
<field name="END">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get names"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="FIND">
|
|
<block type="text">
|
|
<field name="TEXT">Eve</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">find first order complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">find last complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_indexOf" inline="false">
|
|
<field name="END">LAST</field>
|
|
<value name="VALUE">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get names"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="FIND">
|
|
<block type="text">
|
|
<field name="TEXT">Eve</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">find last complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">find last order complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_indexOf" inline="false">
|
|
<field name="END">LAST</field>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get names"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="FIND">
|
|
<block type="text">
|
|
<field name="TEXT">Eve</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">find last order complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">find none complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_indexOf" inline="false">
|
|
<field name="END">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get names"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="FIND">
|
|
<block type="text">
|
|
<field name="TEXT">Dave</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">-1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">find none complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">find none order complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_indexOf" inline="false">
|
|
<field name="END">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get names"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="FIND">
|
|
<block type="text">
|
|
<field name="TEXT">Dave</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">-1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">find none order complex</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="3738">
|
|
<field name="NAME">test get simple</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "get" block with a variable.</comment>
|
|
<statement name="STACK">
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get first simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="false"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get last simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="false"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">LAST</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertvalue" inline="false">
|
|
<field name="EXPECTED">TRUE</field>
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get random simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="logic_compare">
|
|
<field name="OP">GT</field>
|
|
<value name="A">
|
|
<block type="lists_indexOf" inline="false">
|
|
<field name="END">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="FIND">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="false"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">RANDOM</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">-1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get # simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="true"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">FROM_START</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get # order simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="true"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">FROM_START</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get #-end simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="true"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">FROM_END</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get #-end order simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="true"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">FROM_END</field>
|
|
<comment pinned="false" h="81" w="289">The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index.</comment>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="math_arithmetic">
|
|
<field name="OP">ADD</field>
|
|
<value name="A">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defreturn" x="13" y="4538">
|
|
<field name="NAME">get star wars</field>
|
|
<comment pinned="false" h="80" w="160">Creates a list for use with the get test.</comment>
|
|
<statement name="STACK">
|
|
<block type="math_change">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="DELTA">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</statement>
|
|
<value name="RETURN">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="4663">
|
|
<field name="NAME">test get complex</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "get" block with a function call.</comment>
|
|
<statement name="STACK">
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get first complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="false"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get star wars"></mutation>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">get first complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get first order complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="false"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get star wars"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">get first order complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get last complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="false"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">LAST</field>
|
|
<value name="VALUE">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get star wars"></mutation>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">get last complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get last order complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="false"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">LAST</field>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get star wars"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">get last order complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertvalue" inline="false">
|
|
<field name="EXPECTED">TRUE</field>
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get random complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="logic_compare">
|
|
<field name="OP">GT</field>
|
|
<value name="A">
|
|
<block type="lists_indexOf" inline="false">
|
|
<field name="END">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="FIND">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="false"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">RANDOM</field>
|
|
<value name="VALUE">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get star wars"></mutation>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">-1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">get random complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertvalue" inline="false">
|
|
<field name="EXPECTED">TRUE</field>
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get random order complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="logic_compare">
|
|
<field name="OP">GT</field>
|
|
<value name="A">
|
|
<block type="lists_indexOf" inline="false">
|
|
<field name="END">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="FIND">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="false"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">RANDOM</field>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get star wars"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">-1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">get random order complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get # complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="true"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">FROM_START</field>
|
|
<value name="VALUE">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get star wars"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">get # complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get # order complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="true"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">FROM_START</field>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get star wars"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="logic_ternary">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">get # order complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get #-end complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="true"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">FROM_END</field>
|
|
<value name="VALUE">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get star wars"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">get #-end complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">get #-end order complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="true"></mutation>
|
|
<field name="MODE">GET</field>
|
|
<field name="WHERE">FROM_END</field>
|
|
<comment pinned="false" h="87" w="299">The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index.</comment>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get star wars"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="math_arithmetic">
|
|
<field name="OP">ADD</field>
|
|
<value name="A">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">get #-end order complex</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="6488">
|
|
<field name="NAME">test getRemove</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "get and remove" block.</comment>
|
|
<statement name="STACK">
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove first</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="false"></mutation>
|
|
<field name="MODE">GET_REMOVE</field>
|
|
<field name="WHERE">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove first list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove first order</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="false"></mutation>
|
|
<field name="MODE">GET_REMOVE</field>
|
|
<field name="WHERE">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove first order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove last</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="false"></mutation>
|
|
<field name="MODE">GET_REMOVE</field>
|
|
<field name="WHERE">LAST</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove last list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove last order</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="false"></mutation>
|
|
<field name="MODE">GET_REMOVE</field>
|
|
<field name="WHERE">LAST</field>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove last order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertvalue" inline="false">
|
|
<field name="EXPECTED">TRUE</field>
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove random</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="logic_compare">
|
|
<field name="OP">EQ</field>
|
|
<value name="A">
|
|
<block type="lists_indexOf" inline="false">
|
|
<field name="END">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="FIND">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="false"></mutation>
|
|
<field name="MODE">GET_REMOVE</field>
|
|
<field name="WHERE">RANDOM</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">-1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove random list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_length" inline="false">
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertvalue" inline="false">
|
|
<field name="EXPECTED">TRUE</field>
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove random order</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="logic_compare">
|
|
<field name="OP">EQ</field>
|
|
<value name="A">
|
|
<block type="lists_indexOf" inline="false">
|
|
<field name="END">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="FIND">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="false"></mutation>
|
|
<field name="MODE">GET_REMOVE</field>
|
|
<field name="WHERE">RANDOM</field>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="false">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">-1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove random order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_length" inline="false">
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove #</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="true"></mutation>
|
|
<field name="MODE">GET_REMOVE</field>
|
|
<field name="WHERE">FROM_START</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove # list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove # order</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="true"></mutation>
|
|
<field name="MODE">GET_REMOVE</field>
|
|
<field name="WHERE">FROM_START</field>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="false">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="logic_ternary">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove # order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove #-end</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="true"></mutation>
|
|
<field name="MODE">GET_REMOVE</field>
|
|
<field name="WHERE">FROM_END</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove #-end list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove #-end order</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getIndex">
|
|
<mutation statement="false" at="true"></mutation>
|
|
<field name="MODE">GET_REMOVE</field>
|
|
<field name="WHERE">FROM_END</field>
|
|
<comment pinned="false" h="94" w="258">The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index.</comment>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="math_arithmetic">
|
|
<field name="OP">ADD</field>
|
|
<value name="A">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">getremove #-end order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="8888">
|
|
<field name="NAME">test remove</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "remove" block.</comment>
|
|
<statement name="STACK">
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_getIndex">
|
|
<mutation statement="true" at="false"></mutation>
|
|
<field name="MODE">REMOVE</field>
|
|
<field name="WHERE">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">remove first list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_getIndex">
|
|
<mutation statement="true" at="false"></mutation>
|
|
<field name="MODE">REMOVE</field>
|
|
<field name="WHERE">FIRST</field>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">remove first order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_getIndex">
|
|
<mutation statement="true" at="false"></mutation>
|
|
<field name="MODE">REMOVE</field>
|
|
<field name="WHERE">LAST</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">remove last list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_getIndex">
|
|
<mutation statement="true" at="false"></mutation>
|
|
<field name="MODE">REMOVE</field>
|
|
<field name="WHERE">LAST</field>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">remove last order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_getIndex">
|
|
<mutation statement="true" at="false"></mutation>
|
|
<field name="MODE">REMOVE</field>
|
|
<field name="WHERE">RANDOM</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">remove random list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_length" inline="false">
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_getIndex">
|
|
<mutation statement="true" at="false"></mutation>
|
|
<field name="MODE">REMOVE</field>
|
|
<field name="WHERE">RANDOM</field>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">remove random order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_length" inline="false">
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_getIndex">
|
|
<mutation statement="true" at="true"></mutation>
|
|
<field name="MODE">REMOVE</field>
|
|
<field name="WHERE">FROM_START</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">remove # list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_getIndex">
|
|
<mutation statement="true" at="true"></mutation>
|
|
<field name="MODE">REMOVE</field>
|
|
<field name="WHERE">FROM_START</field>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="false">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="logic_ternary">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">remove # order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_getIndex">
|
|
<mutation statement="true" at="true"></mutation>
|
|
<field name="MODE">REMOVE</field>
|
|
<field name="WHERE">FROM_END</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">remove #-end list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Kirk</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_getIndex">
|
|
<mutation statement="true" at="true"></mutation>
|
|
<field name="MODE">REMOVE</field>
|
|
<field name="WHERE">FROM_END</field>
|
|
<comment pinned="false" h="94" w="256">The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index.</comment>
|
|
<value name="VALUE">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="math_arithmetic">
|
|
<field name="OP">ADD</field>
|
|
<value name="A">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">remove #-end order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Spock</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">McCoy</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="10713">
|
|
<field name="NAME">test set</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "set" block.</comment>
|
|
<statement name="STACK">
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="false"></mutation>
|
|
<field name="MODE">SET</field>
|
|
<field name="WHERE">FIRST</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Jean-Luc</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">set first list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Jean-Luc</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="false"></mutation>
|
|
<field name="MODE">SET</field>
|
|
<field name="WHERE">FIRST</field>
|
|
<value name="LIST">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Jean-Luc</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">set first order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Jean-Luc</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="false"></mutation>
|
|
<field name="MODE">SET</field>
|
|
<field name="WHERE">LAST</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Beverly</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">set last list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Beverly</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="false"></mutation>
|
|
<field name="MODE">SET</field>
|
|
<field name="WHERE">LAST</field>
|
|
<value name="LIST">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Beverly</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">set last order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Beverly</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="false"></mutation>
|
|
<field name="MODE">SET</field>
|
|
<field name="WHERE">RANDOM</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">set random list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_length" inline="false">
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="false"></mutation>
|
|
<field name="MODE">SET</field>
|
|
<field name="WHERE">RANDOM</field>
|
|
<value name="LIST">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">set random order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_length" inline="false">
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="true"></mutation>
|
|
<field name="MODE">SET</field>
|
|
<field name="WHERE">FROM_START</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Pulaski</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">set # list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Pulaski</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="true"></mutation>
|
|
<field name="MODE">SET</field>
|
|
<field name="WHERE">FROM_START</field>
|
|
<value name="LIST">
|
|
<block type="logic_ternary" inline="false">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="logic_ternary" inline="false">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Pulaski</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">set # order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Pulaski</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="true"></mutation>
|
|
<field name="MODE">SET</field>
|
|
<field name="WHERE">FROM_END</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Pulaski</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">set #-end list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Pulaski</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="true"></mutation>
|
|
<field name="MODE">SET</field>
|
|
<field name="WHERE">FROM_END</field>
|
|
<comment pinned="false" h="88" w="258">The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index.</comment>
|
|
<value name="LIST">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="math_arithmetic">
|
|
<field name="OP">ADD</field>
|
|
<value name="A">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Pulaski</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">set #-end order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Pulaski</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="12538">
|
|
<field name="NAME">test insert</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "insert" block.</comment>
|
|
<statement name="STACK">
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="false"></mutation>
|
|
<field name="MODE">INSERT</field>
|
|
<field name="WHERE">FIRST</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">insert first list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="4"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="false"></mutation>
|
|
<field name="MODE">INSERT</field>
|
|
<field name="WHERE">FIRST</field>
|
|
<value name="LIST">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">insert first order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="4"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="false"></mutation>
|
|
<field name="MODE">INSERT</field>
|
|
<field name="WHERE">LAST</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">insert last list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="4"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="false"></mutation>
|
|
<field name="MODE">INSERT</field>
|
|
<field name="WHERE">LAST</field>
|
|
<value name="LIST">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">insert last order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="4"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="false"></mutation>
|
|
<field name="MODE">INSERT</field>
|
|
<field name="WHERE">RANDOM</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">insert random list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_length" inline="false">
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="math_number">
|
|
<field name="NUM">4</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="false"></mutation>
|
|
<field name="MODE">INSERT</field>
|
|
<field name="WHERE">RANDOM</field>
|
|
<value name="LIST">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">insert random order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_length" inline="false">
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="math_number">
|
|
<field name="NUM">4</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="true"></mutation>
|
|
<field name="MODE">INSERT</field>
|
|
<field name="WHERE">FROM_START</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">insert # list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="4"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="true"></mutation>
|
|
<field name="MODE">INSERT</field>
|
|
<field name="WHERE">FROM_START</field>
|
|
<value name="LIST">
|
|
<block type="logic_ternary" inline="false">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="logic_ternary">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">insert # order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="4"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="true"></mutation>
|
|
<field name="MODE">INSERT</field>
|
|
<field name="WHERE">FROM_END</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">insert #-end list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="4"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_setIndex">
|
|
<mutation at="true"></mutation>
|
|
<field name="MODE">INSERT</field>
|
|
<field name="WHERE">FROM_END</field>
|
|
<comment pinned="false" h="77" w="263">The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index.</comment>
|
|
<value name="LIST">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT">
|
|
<block type="math_arithmetic">
|
|
<field name="OP">ADD</field>
|
|
<value name="A">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="TO">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">insert #-end order list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="4"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Picard</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Data</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Riker</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Crusher</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="14363">
|
|
<field name="NAME">test sublist simple</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "get sub-list" block with a variable.</comment>
|
|
<statement name="STACK">
|
|
<block type="variables_set" inline="false">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="5"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Columbia</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Challenger</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD4">
|
|
<block type="text">
|
|
<field name="TEXT">Endeavour</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist # simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_START</field>
|
|
<field name="WHERE2">FROM_START</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Challenger</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist # simple order</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_START</field>
|
|
<field name="WHERE2">FROM_START</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="logic_ternary">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="logic_ternary">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Challenger</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist #-end simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_END</field>
|
|
<field name="WHERE2">FROM_END</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist #-end simple order</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_END</field>
|
|
<field name="WHERE2">FROM_END</field>
|
|
<comment pinned="false" h="80" w="265">The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index.</comment>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="math_arithmetic">
|
|
<field name="OP">ADD</field>
|
|
<value name="A">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="math_arithmetic">
|
|
<field name="OP">ADD</field>
|
|
<value name="A">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist first-last simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="false" at2="false"></mutation>
|
|
<field name="WHERE1">FIRST</field>
|
|
<field name="WHERE2">LAST</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">changing list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="5"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Columbia</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Challenger</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD4">
|
|
<block type="text">
|
|
<field name="TEXT">Endeavour</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">list copy</field>
|
|
<value name="VALUE">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="false" at2="false"></mutation>
|
|
<field name="WHERE1">FIRST</field>
|
|
<field name="WHERE2">LAST</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">changing list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="lists_getIndex">
|
|
<mutation statement="true" at="false"></mutation>
|
|
<field name="MODE">REMOVE</field>
|
|
<field name="WHERE">RANDOM</field>
|
|
<value name="VALUE">
|
|
<block type="variables_get">
|
|
<field name="VAR">changing list</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist first-last simple copy check</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">list copy</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist # #-end simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_START</field>
|
|
<field name="WHERE2">FROM_END</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Challenger</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist #-end # simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_END</field>
|
|
<field name="WHERE2">FROM_START</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist first # simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="false" at2="true"></mutation>
|
|
<field name="WHERE1">FIRST</field>
|
|
<field name="WHERE2">FROM_START</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="4"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Columbia</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Challenger</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist first #-end simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="false" at2="true"></mutation>
|
|
<field name="WHERE1">FIRST</field>
|
|
<field name="WHERE2">FROM_END</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Columbia</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Challenger</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist # last simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="false"></mutation>
|
|
<field name="WHERE1">FROM_START</field>
|
|
<field name="WHERE2">LAST</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Endeavour</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist #-end last simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="false"></mutation>
|
|
<field name="WHERE1">FROM_END</field>
|
|
<field name="WHERE2">LAST</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="4"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Challenger</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Endeavour</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist all with # #-end simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_START</field>
|
|
<field name="WHERE2">FROM_END</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist all with #-end # simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_END</field>
|
|
<field name="WHERE2">FROM_START</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">4</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">4</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist all with # #-end math simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_START</field>
|
|
<field name="WHERE2">FROM_END</field>
|
|
<comment pinned="false" h="93" w="347">Checks that the whole list is properly retrieved even if the value for start and end is not a simple number. This is especially important in generators where sublist uses [x:length - y] for # #-end.</comment>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="math_arithmetic">
|
|
<field name="OP">ADD</field>
|
|
<value name="A">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="math_arithmetic">
|
|
<field name="OP">ADD</field>
|
|
<value name="A">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defreturn" x="13" y="16238">
|
|
<field name="NAME">get space shuttles</field>
|
|
<comment pinned="false" h="80" w="160">Creates a list for use with the sublist test.</comment>
|
|
<statement name="STACK">
|
|
<block type="math_change">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="DELTA">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</statement>
|
|
<value name="RETURN">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="5"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Columbia</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Challenger</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD4">
|
|
<block type="text">
|
|
<field name="TEXT">Endeavour</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="16363">
|
|
<field name="NAME">test sublist complex</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "get sub-list" block with a function call.</comment>
|
|
<statement name="STACK">
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist # start complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_START</field>
|
|
<field name="WHERE2">FROM_START</field>
|
|
<value name="LIST">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get space shuttles"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Challenger</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">sublist # start complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist # start order complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_START</field>
|
|
<field name="WHERE2">FROM_START</field>
|
|
<value name="LIST">
|
|
<block type="logic_ternary">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get space shuttles"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="logic_ternary">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="logic_ternary">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Challenger</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">sublist # start order complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist # end complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_END</field>
|
|
<field name="WHERE2">FROM_END</field>
|
|
<comment pinned="false" h="78" w="267">The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index.</comment>
|
|
<value name="LIST">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get space shuttles"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist # end complex number of calls</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="variables_get">
|
|
<field name="VAR">number of calls</field>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist # end order complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_END</field>
|
|
<field name="WHERE2">FROM_END</field>
|
|
<value name="LIST">
|
|
<block type="logic_ternary" inline="false">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get space shuttles"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="math_arithmetic">
|
|
<field name="OP">ADD</field>
|
|
<value name="A">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="math_arithmetic">
|
|
<field name="OP">ADD</field>
|
|
<value name="A">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">sublist # end order complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist first-last complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="false" at2="false"></mutation>
|
|
<field name="WHERE1">FIRST</field>
|
|
<field name="WHERE2">LAST</field>
|
|
<value name="LIST">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get space shuttles"></mutation>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">sublist first-last complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist # #-end complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_START</field>
|
|
<field name="WHERE2">FROM_END</field>
|
|
<value name="LIST">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get space shuttles"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Challenger</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">sublist # #-end complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist #-end # complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_END</field>
|
|
<field name="WHERE2">FROM_START</field>
|
|
<value name="LIST">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get space shuttles"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">2</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">sublist #-end # complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist first # complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="false" at2="true"></mutation>
|
|
<field name="WHERE1">FIRST</field>
|
|
<field name="WHERE2">FROM_START</field>
|
|
<value name="LIST">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get space shuttles"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="4"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Columbia</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Challenger</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">sublist first # complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist first #-end complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="false" at2="true"></mutation>
|
|
<field name="WHERE1">FIRST</field>
|
|
<field name="WHERE2">FROM_END</field>
|
|
<value name="LIST">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get space shuttles"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Columbia</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Challenger</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">sublist first #-end complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist # last complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="false"></mutation>
|
|
<field name="WHERE1">FROM_START</field>
|
|
<field name="WHERE2">LAST</field>
|
|
<value name="LIST">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get space shuttles"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="2"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Endeavour</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">sublist # last complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist #-end last simple</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="false"></mutation>
|
|
<field name="WHERE1">FROM_END</field>
|
|
<field name="WHERE2">LAST</field>
|
|
<value name="LIST">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get space shuttles"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">3</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="4"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Challenger</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Discovery</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Atlantis</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD3">
|
|
<block type="text">
|
|
<field name="TEXT">Endeavour</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">sublist #-end last simple</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist all with # #-end complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_START</field>
|
|
<field name="WHERE2">FROM_END</field>
|
|
<value name="LIST">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get space shuttles"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">sublist all with # #-end complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist all with #-end # complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_END</field>
|
|
<field name="WHERE2">FROM_START</field>
|
|
<value name="LIST">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get space shuttles"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">4</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">4</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">sublist all with #-end # complex</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="variables_set">
|
|
<field name="VAR">number of calls</field>
|
|
<value name="VALUE">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sublist all with # #-end math complex</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_getSublist">
|
|
<mutation at1="true" at2="true"></mutation>
|
|
<field name="WHERE1">FROM_START</field>
|
|
<field name="WHERE2">FROM_END</field>
|
|
<comment pinned="false" h="96" w="315">Checks that the whole list is properly retrieved even if the value for start and end is not a simple number. This is especially important in generators where sublist uses [x:length - y] for # #-end.</comment>
|
|
<value name="LIST">
|
|
<block type="procedures_callreturn">
|
|
<mutation name="get space shuttles"></mutation>
|
|
</block>
|
|
</value>
|
|
<value name="AT1">
|
|
<block type="math_arithmetic">
|
|
<field name="OP">ADD</field>
|
|
<value name="A">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="AT2">
|
|
<block type="math_arithmetic">
|
|
<field name="OP">ADD</field>
|
|
<value name="A">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
<value name="B">
|
|
<block type="unittest_adjustindex">
|
|
<value name="INDEX">
|
|
<block type="math_number">
|
|
<field name="NUM">0</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="procedures_callnoreturn" inline="true">
|
|
<mutation name="check number of calls">
|
|
<arg name="test name"></arg>
|
|
</mutation>
|
|
<value name="ARG0">
|
|
<block type="text">
|
|
<field name="TEXT">sublist all with # #-end math complex</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="18963">
|
|
<field name="NAME">test join</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "join" block.</comment>
|
|
<statement name="STACK">
|
|
<block type="variables_set">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Vulcan</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Klingon</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Borg</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">join</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_split">
|
|
<mutation mode="JOIN"></mutation>
|
|
<field name="MODE">JOIN</field>
|
|
<value name="INPUT">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="DELIM">
|
|
<block type="text">
|
|
<field name="TEXT">,</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Vulcan,Klingon,Borg</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">join order</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_split">
|
|
<mutation mode="JOIN"></mutation>
|
|
<field name="MODE">JOIN</field>
|
|
<value name="INPUT">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="DELIM">
|
|
<block type="text">
|
|
<field name="TEXT">,</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="text">
|
|
<field name="TEXT">Vulcan,Klingon,Borg</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="19263">
|
|
<field name="NAME">test split</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "split" block.</comment>
|
|
<statement name="STACK">
|
|
<block type="variables_set">
|
|
<field name="VAR">text</field>
|
|
<value name="VALUE">
|
|
<block type="text">
|
|
<field name="TEXT">Vulcan,Klingon,Borg</field>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">split</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_split">
|
|
<mutation mode="SPLIT"></mutation>
|
|
<field name="MODE">SPLIT</field>
|
|
<value name="INPUT">
|
|
<block type="variables_get">
|
|
<field name="VAR">text</field>
|
|
</block>
|
|
</value>
|
|
<value name="DELIM">
|
|
<block type="text">
|
|
<field name="TEXT">,</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Vulcan</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Klingon</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Borg</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">split order</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_split">
|
|
<mutation mode="SPLIT"></mutation>
|
|
<field name="MODE">SPLIT</field>
|
|
<value name="INPUT">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">text</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="DELIM">
|
|
<block type="text">
|
|
<field name="TEXT">,</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Vulcan</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Klingon</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Borg</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="19563">
|
|
<field name="NAME">test sort alphabetic</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "alphabetic sort" block.</comment>
|
|
<statement name="STACK">
|
|
<block type="variables_set">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Vulcan</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">klingon</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Borg</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sort alphabetic ascending</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_sort">
|
|
<field name="TYPE">TEXT</field>
|
|
<field name="DIRECTION">1</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Borg</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Vulcan</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">klingon</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sort alphabetic ascending order</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_sort">
|
|
<field name="TYPE">TEXT</field>
|
|
<field name="DIRECTION">1</field>
|
|
<value name="LIST">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Borg</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">Vulcan</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">klingon</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="19863">
|
|
<field name="NAME">test sort ignoreCase</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "alphabetic sort ignore case" block.</comment>
|
|
<statement name="STACK">
|
|
<block type="variables_set">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Vulcan</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">klingon</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Borg</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sort ignore case ascending</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_sort">
|
|
<field name="TYPE">IGNORE_CASE</field>
|
|
<field name="DIRECTION">1</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Borg</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">klingon</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Vulcan</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sort ignore case ascending order</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_sort">
|
|
<field name="TYPE">IGNORE_CASE</field>
|
|
<field name="DIRECTION">1</field>
|
|
<value name="LIST">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="text">
|
|
<field name="TEXT">Borg</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="text">
|
|
<field name="TEXT">klingon</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="text">
|
|
<field name="TEXT">Vulcan</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
<block type="procedures_defnoreturn" x="13" y="20163">
|
|
<field name="NAME">test sort numeric</field>
|
|
<comment pinned="false" h="80" w="160">Tests the "numeric sort" block.</comment>
|
|
<statement name="STACK">
|
|
<block type="variables_set">
|
|
<field name="VAR">list</field>
|
|
<value name="VALUE">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="math_number">
|
|
<field name="NUM">8</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="math_number">
|
|
<field name="NUM">18</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="math_number">
|
|
<field name="NUM">-1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sort numeric descending</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_sort">
|
|
<field name="TYPE">NUMERIC</field>
|
|
<field name="DIRECTION">-1</field>
|
|
<value name="LIST">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="math_number">
|
|
<field name="NUM">18</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="math_number">
|
|
<field name="NUM">8</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="math_number">
|
|
<field name="NUM">-1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<next>
|
|
<block type="unittest_assertequals" inline="false">
|
|
<value name="MESSAGE">
|
|
<block type="text">
|
|
<field name="TEXT">sort numeric descending order</field>
|
|
</block>
|
|
</value>
|
|
<value name="ACTUAL">
|
|
<block type="lists_sort">
|
|
<field name="TYPE">NUMERIC</field>
|
|
<field name="DIRECTION">-1</field>
|
|
<value name="LIST">
|
|
<block type="logic_ternary" inline="true">
|
|
<value name="IF">
|
|
<block type="logic_boolean">
|
|
<field name="BOOL">TRUE</field>
|
|
</block>
|
|
</value>
|
|
<value name="THEN">
|
|
<block type="variables_get">
|
|
<field name="VAR">list</field>
|
|
</block>
|
|
</value>
|
|
<value name="ELSE">
|
|
<block type="logic_null"></block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
<value name="EXPECTED">
|
|
<block type="lists_create_with" inline="true">
|
|
<mutation items="3"></mutation>
|
|
<value name="ADD0">
|
|
<block type="math_number">
|
|
<field name="NUM">18</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD1">
|
|
<block type="math_number">
|
|
<field name="NUM">8</field>
|
|
</block>
|
|
</value>
|
|
<value name="ADD2">
|
|
<block type="math_number">
|
|
<field name="NUM">-1</field>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</value>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</next>
|
|
</block>
|
|
</statement>
|
|
</block>
|
|
</xml> |