File "colour.xml"

Full path: /usr/home/mndrn/domains/mndrn.ru/public_html/block-hill/blockly/tests/generators/colour.xml
File size: 12.74 KiB (13041 bytes)
MIME-type: text/plain
Charset: utf-8

Download   Open   Back

<xml xmlns="https://developers.google.com/blockly/xml">
  <block type="procedures_defnoreturn" x="260" y="14">
    <field name="NAME">test colour picker</field>
    <comment pinned="false" h="80" w="160">Describe this function...</comment>
    <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>
    <comment pinned="false" h="80" w="160">Describe this function...</comment>
    <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">
    <field name="SUITE_NAME">Colour</field>
    <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>
    <comment pinned="false" h="80" w="160">Describe this function...</comment>
    <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_join">
                    <mutation items="2"></mutation>
                    <value name="ADD0">
                      <block type="text">
                        <field name="TEXT">length of random colour string: </field>
                      </block>
                    </value>
                    <value name="ADD1">
                      <block type="variables_get">
                        <field name="VAR">item</field>
                      </block>
                    </value>
                  </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_join">
                        <mutation items="2"></mutation>
                        <value name="ADD0">
                          <block type="text">
                            <field name="TEXT">format of random colour string: </field>
                          </block>
                        </value>
                        <value name="ADD1">
                          <block type="variables_get">
                            <field name="VAR">item</field>
                          </block>
                        </value>
                      </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">1</field>
                          </block>
                        </value>
                        <value name="TO">
                          <block type="math_number">
                            <field name="NUM">6</field>
                          </block>
                        </value>
                        <statement name="DO">
                          <block type="unittest_assertvalue" inline="false">
                            <field name="EXPECTED">TRUE</field>
                            <value name="MESSAGE">
                              <block type="text_join">
                                <mutation items="4"></mutation>
                                <value name="ADD0">
                                  <block type="text">
                                    <field name="TEXT">contents of random colour string: </field>
                                  </block>
                                </value>
                                <value name="ADD1">
                                  <block type="variables_get">
                                    <field name="VAR">item</field>
                                  </block>
                                </value>
                                <value name="ADD2">
                                  <block type="text">
                                    <field name="TEXT"> at index: </field>
                                  </block>
                                </value>
                                <value name="ADD3">
                                  <block type="unittest_adjustindex">
                                    <value name="INDEX">
                                      <block type="variables_get">
                                        <field name="VAR">i</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <value name="ACTUAL">
                              <block type="logic_compare">
                                <field name="OP">NEQ</field>
                                <value name="A">
                                  <block type="unittest_adjustindex">
                                    <value name="INDEX">
                                      <block type="math_number">
                                        <field name="NUM">-1</field>
                                      </block>
                                    </value>
                                  </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="unittest_adjustindex">
                                            <value name="INDEX">
                                              <block type="variables_get">
                                                <field name="VAR">i</field>
                                              </block>
                                            </value>
                                          </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="638" y="213">
    <field name="NAME">test blend</field>
    <comment pinned="false" h="80" w="160">Describe this function...</comment>
    <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>

PHP File Manager