aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/small_tests_SUITE_data/src/ets_select.erl
blob: 2b3c38cd5977e553f39fc0049257e633c93f3f01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
-module(ets_select).
-export([test/0]).

test() ->
  Table = ets:new(table, [set,{keypos,1}]),
  ets:insert(Table, {foo, bar, baz}),
  foo(Table). % ets:select(Table, [{{'_', '$1', '$2'}, [], ['$$']}]).

foo(Table) ->
  Tuples = ets:select(Table, [{{'_', '$1', '$2'}, [], ['$$']}]),
  [list_to_tuple(Tuple) || Tuple <- Tuples].