Skip to content

Instantly share code, notes, and snippets.

@gogiel
Created February 15, 2015 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gogiel/f33f6236fe1147e77eda to your computer and use it in GitHub Desktop.
Save gogiel/f33f6236fe1147e77eda to your computer and use it in GitHub Desktop.
ExUnit.start
defmodule EtsAssertion do
use ExUnit.Case
test "ets" do
:ets.new(:table, [:named_table, :bag])
:ets.insert(:table, [{:items, :a, :b, :c}, {:items, :a, :x, :x}])
result = :ets.match(:table, {:items, '$1', '$2', '_'})
assert result == [[:a, :b],[:a, :x]]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment