Exemplo n.º 1
0
    def test_arrays():
        empty = Var(No(T.Example.array))
        single = Var(ArrayLiteral([Self.cast(Example)]))
        complete = Var(Self.parent.cast(T.Example.list).as_array)

        arr = Var(empty.concat(single).concat(complete))
        return arr.length  # BREAK:test_arrays
Exemplo n.º 2
0
    def mmz_prop():
        # Both calls to unit_count are memoized, but when called for the first
        # time, the first one's result will be different from the second one.
        before = Var([Self.unit_count])

        # Update context version by parsing a new unit
        ignore(Var(Self.fetch_example_unit))

        after = Var([Self.unit_count])

        return before.concat(after)