summaryrefslogtreecommitdiff
path: root/blockly/tests/generators/variables.xml
blob: a11d0a01aa13971deae6ae77e0c9a90abf2fd4d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<xml xmlns="http://www.w3.org/1999/xhtml">
  <block type="unittest_main" x="0" y="0">
    <statement name="DO">
      <block type="variables_set" inline="false">
        <field name="VAR">item</field>
        <value name="VALUE">
          <block type="math_number">
            <field name="NUM">123</field>
          </block>
        </value>
        <next>
          <block type="unittest_assertequals" inline="false">
            <value name="MESSAGE">
               <block type="text">
                 <field name="TEXT">variable</field>
               </block>
             </value>
            <value name="ACTUAL">
              <block type="variables_get">
                <field name="VAR">item</field>
              </block>
            </value>
            <value name="EXPECTED">
              <block type="math_number">
                <field name="NUM">123</field>
              </block>
            </value>
            <next>
              <block type="variables_set" inline="false">
                <field name="VAR">if</field>
                <value name="VALUE">
                  <block type="math_number">
                    <field name="NUM">123</field>
                  </block>
                </value>
                <next>
                  <block type="unittest_assertequals" inline="false">
                    <value name="MESSAGE">
                       <block type="text">
                         <field name="TEXT">reserved variable</field>
                       </block>
                     </value>
                    <value name="ACTUAL">
                      <block type="variables_get">
                        <field name="VAR">if</field>
                      </block>
                    </value>
                    <value name="EXPECTED">
                      <block type="math_number">
                        <field name="NUM">123</field>
                      </block>
                    </value>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </next>
      </block>
    </statement>
  </block>
  <block type="variables_get" x="300" y="100">
    <field name="VAR">naked</field>
    <comment pinned="true" h="80" w="160">Intentionally non-connected variable.</comment>
  </block>
</xml>