Skip to content

Commit

Permalink
Add a test (should cause lcov to work, I think?)
Browse files Browse the repository at this point in the history
  • Loading branch information
jzimbel-mbta authored Aug 5, 2024
1 parent 10ba862 commit 3492482
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/transit_data/glides_report/util_text.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
defmodule TransitData.GlidesReport.UtilTest do
use ExUnit.Case, async: true

alias TransitData.GlidesReport.Util

describe "stream_values/1" do
setup do
table = :ets.new(TransitData.GlidesReport.UtilTest.Table)
on_exit(fn -> :ets.delete(table) end)

%{table: table}
end

test "streams values from a table", %{table: table} do
objects = [a: 1, b: 2, c: 3, d: 4]
:ets.insert(table, objects)

from_stream = Util.stream_values(table)

assert Enum.sort(objects) == Enum.sort(from_stream)
end
end
end

0 comments on commit 3492482

Please sign in to comment.