summaryrefslogtreecommitdiff
path: root/blockly/tests/generators/colour.xml
diff options
context:
space:
mode:
Diffstat (limited to 'blockly/tests/generators/colour.xml')
-rw-r--r--blockly/tests/generators/colour.xml261
1 files changed, 261 insertions, 0 deletions
diff --git a/blockly/tests/generators/colour.xml b/blockly/tests/generators/colour.xml
new file mode 100644
index 0000000..bae853d
--- /dev/null
+++ b/blockly/tests/generators/colour.xml
@@ -0,0 +1,261 @@
+<xml xmlns="http://www.w3.org/1999/xhtml">
+ <block type="procedures_defnoreturn" x="260" y="14">
+ <field name="NAME">test colour picker</field>
+ <statement name="STACK">
+ <block type="unittest_assertequals" inline="false">
+ <value name="MESSAGE">
+ <block type="text">
+ <field name="TEXT">static colour</field>
+ </block>
+ </value>
+ <value name="ACTUAL">
+ <block type="colour_picker">
+ <field name="COLOUR">#ff6600</field>
+ </block>
+ </value>
+ <value name="EXPECTED">
+ <block type="text">
+ <field name="TEXT">#ff6600</field>
+ </block>
+ </value>
+ </block>
+ </statement>
+ </block>
+ <block type="procedures_defnoreturn" x="630" y="13">
+ <field name="NAME">test rgb</field>
+ <statement name="STACK">
+ <block type="unittest_assertequals" inline="false">
+ <value name="MESSAGE">
+ <block type="text">
+ <field name="TEXT">from rgb</field>
+ </block>
+ </value>
+ <value name="ACTUAL">
+ <block type="colour_rgb" inline="false">
+ <value name="RED">
+ <block type="math_number">
+ <field name="NUM">100</field>
+ </block>
+ </value>
+ <value name="GREEN">
+ <block type="math_number">
+ <field name="NUM">40</field>
+ </block>
+ </value>
+ <value name="BLUE">
+ <block type="math_number">
+ <field name="NUM">0</field>
+ </block>
+ </value>
+ </block>
+ </value>
+ <value name="EXPECTED">
+ <block type="text">
+ <field name="TEXT">#ff6600</field>
+ </block>
+ </value>
+ </block>
+ </statement>
+ </block>
+ <block type="unittest_main" x="-5" y="49">
+ <statement name="DO">
+ <block type="procedures_callnoreturn">
+ <mutation name="test colour picker"></mutation>
+ <next>
+ <block type="procedures_callnoreturn">
+ <mutation name="test blend"></mutation>
+ <next>
+ <block type="procedures_callnoreturn">
+ <mutation name="test rgb"></mutation>
+ <next>
+ <block type="procedures_callnoreturn">
+ <mutation name="test colour random"></mutation>
+ </block>
+ </next>
+ </block>
+ </next>
+ </block>
+ </next>
+ </block>
+ </statement>
+ </block>
+ <block type="procedures_defnoreturn" x="-7" y="223">
+ <field name="NAME">test colour random</field>
+ <statement name="STACK">
+ <block type="controls_repeat_ext" inline="true">
+ <value name="TIMES">
+ <block type="math_number">
+ <field name="NUM">100</field>
+ </block>
+ </value>
+ <statement name="DO">
+ <block type="variables_set" inline="false">
+ <field name="VAR">item</field>
+ <value name="VALUE">
+ <block type="colour_random"></block>
+ </value>
+ <next>
+ <block type="unittest_assertequals" inline="false">
+ <value name="MESSAGE">
+ <block type="text">
+ <field name="TEXT">test name</field>
+ </block>
+ </value>
+ <value name="ACTUAL">
+ <block type="text_length" inline="false">
+ <value name="VALUE">
+ <block type="variables_get">
+ <field name="VAR">item</field>
+ </block>
+ </value>
+ </block>
+ </value>
+ <value name="EXPECTED">
+ <block type="math_number">
+ <field name="NUM">7</field>
+ </block>
+ </value>
+ <next>
+ <block type="unittest_assertequals" inline="false">
+ <value name="MESSAGE">
+ <block type="text">
+ <field name="TEXT">test name</field>
+ </block>
+ </value>
+ <value name="ACTUAL">
+ <block type="text_charAt">
+ <mutation at="false"></mutation>
+ <field name="WHERE">FIRST</field>
+ <value name="VALUE">
+ <block type="variables_get">
+ <field name="VAR">item</field>
+ </block>
+ </value>
+ </block>
+ </value>
+ <value name="EXPECTED">
+ <block type="text">
+ <field name="TEXT">#</field>
+ </block>
+ </value>
+ <next>
+ <block type="controls_for">
+ <field name="VAR">i</field>
+ <value name="FROM">
+ <block type="math_number">
+ <field name="NUM">2</field>
+ </block>
+ </value>
+ <value name="TO">
+ <block type="math_number">
+ <field name="NUM">7</field>
+ </block>
+ </value>
+ <statement name="DO">
+ <block type="unittest_assertvalue" inline="false">
+ <value name="MESSAGE">
+ <block type="text">
+ <field name="TEXT">test name</field>
+ </block>
+ </value>
+ <field name="EXPECTED">TRUE</field>
+ <value name="ACTUAL">
+ <block type="logic_compare">
+ <field name="OP">NEQ</field>
+ <value name="A">
+ <block type="math_number">
+ <field name="NUM">0</field>
+ </block>
+ </value>
+ <value name="B">
+ <block type="text_indexOf" inline="false">
+ <field name="END">FIRST</field>
+ <value name="VALUE">
+ <block type="text">
+ <field name="TEXT">abcdefABDEF0123456789</field>
+ </block>
+ </value>
+ <value name="FIND">
+ <block type="text_charAt">
+ <mutation at="true"></mutation>
+ <field name="WHERE">FROM_START</field>
+ <value name="VALUE">
+ <block type="variables_get">
+ <field name="VAR">item</field>
+ </block>
+ </value>
+ <value name="AT">
+ <block type="variables_get">
+ <field name="VAR">i</field>
+ </block>
+ </value>
+ </block>
+ </value>
+ </block>
+ </value>
+ </block>
+ </value>
+ </block>
+ </statement>
+ </block>
+ </next>
+ </block>
+ </next>
+ </block>
+ </next>
+ </block>
+ </statement>
+ </block>
+ </statement>
+ </block>
+ <block type="procedures_defnoreturn" x="520" y="205">
+ <field name="NAME">test blend</field>
+ <statement name="STACK">
+ <block type="unittest_assertequals" inline="false">
+ <value name="MESSAGE">
+ <block type="text">
+ <field name="TEXT">blend</field>
+ </block>
+ </value>
+ <value name="ACTUAL">
+ <block type="colour_blend" inline="false">
+ <value name="COLOUR1">
+ <block type="colour_picker">
+ <field name="COLOUR">#ff0000</field>
+ </block>
+ </value>
+ <value name="COLOUR2">
+ <block type="colour_rgb" inline="false">
+ <value name="RED">
+ <block type="math_number">
+ <field name="NUM">100</field>
+ </block>
+ </value>
+ <value name="GREEN">
+ <block type="math_number">
+ <field name="NUM">40</field>
+ </block>
+ </value>
+ <value name="BLUE">
+ <block type="math_number">
+ <field name="NUM">0</field>
+ </block>
+ </value>
+ </block>
+ </value>
+ <value name="RATIO">
+ <block type="math_number">
+ <field name="NUM">0.4</field>
+ </block>
+ </value>
+ </block>
+ </value>
+ <value name="EXPECTED">
+ <block type="text">
+ <field name="TEXT">#ff2900</field>
+ </block>
+ </value>
+ </block>
+ </statement>
+ </block>
+</xml>