Edit

kc3-lang/kc3/test/ikc3/list.out.expected

Branch :

  • test/ikc3/list.out.expected
  • []
    [[]]
    [[],
     []]
    [[],
     [],
     []]
    [[],
     [],
     [],
     []]
    [[],
     []]
    [[],
     [],
     []]
    [[],
     [],
     []]
    [[],
     [],
     [],
     []]
    [[],
     []]
    [[],
     [],
     []]
    [[],
     [],
     [],
     []]
    [[[],
      []],
     [],
     []]
    [[[]],
     []]
    [:a]
    [:a,
     :b]
    [:a,
     :b,
     :c]
    [:a | :b]
    [:a,
     :b | :c]
    [:a,
     :b,
     :c,
     :d]
    [:a,
     :b,
     :c | :d]
    [:a,
     :b,
     :c | :d]
    List.map([1,
              2,
              3,
              4], fn (x) { x * 2 })
    [2,
     4,
     6,
     8]
    List.reverse([1,
                  2,
                  3,
                  4])
    [4,
     3,
     2,
     1]
    List.has?([:read], :read)
    true
    List.has?([:read], :write)
    false
    List.join(["1",
               "2",
               "3"], ", ")
    "1, 2, 3"
    List.each([1,
               2,
               3], fn (x) { puts(x) })
    1
    2
    3
    true
    List.last([1,
               2,
               3])
    3
    List.slice([1,
                2,
                3,
                4,
                5], 2, 4)
    [3,
     4]
    List.length([])
    0
    List.length([1])
    1
    List.length([1,
                 2])
    2
    List.length([1,
                 2,
                 3,
                 4,
                 5])
    5
    type(":")
    Str
    [":"]
    [":"]
    List.append([], [])
    []
    List.append_one([], :x)
    [:x]
    List.do([1,
             2,
             3], x, do
      puts(x) ; x * 2
    end)
    1
    2
    3
    6
    3
    [4,
     5]
    List.do(list_do_source, x, do
      x + 10
    end)
    15
    5
    List.do([{1, :a},
             {2, :b}], {n, symbol}, do
      puts("#{n} #{symbol}")
      symbol
    end)
    1 a
    2 b
    :b
    {2, :b}
    List.do([], item, do
      item
    end)
    void
    List.map_join([1,
                   2,
                   3], x, ", ", do
      "#{x * 2}"
    end)
    "2, 4, 6"
    3
    [{1, :a},
     {2, :b}]
    List.map_join(list_map_join_source, {n, symbol}, "|", do
      "#{n}:#{symbol}"
    end)
    "1:a|2:b"
    {2, :b}
    List.map_join([], item, ",", do
      "#{item}"
    end)
    ""
    List.map_filter([void,
                     0,
                     false,
                     ""], item, do
      item
    end)
    [0,
     false,
     ""]
    List.map_filter([1,
                     2,
                     3], item, do
      if item == 2 do
        void
      else
        item
      end
    end)
    [1,
     3]
    defmodule ListMapFilterStructTest do
      defstruct [value: 0]
    end
    ListMapFilterStructTest
    [%ListMapFilterStructTest{value: 1}]