16 lines
500 B
Elixir
16 lines
500 B
Elixir
defmodule ObrTest do
|
|
use ExUnit.Case
|
|
doctest Obr
|
|
|
|
test "dataframe processing is correct" do
|
|
df = Explorer.DataFrame.new(column_1: ["c", "b", "c", "c"], column_2: [-6.0, 3.0, 1.2, 2.0])
|
|
res = Obr.process_dataframe(df)
|
|
assert res == [{"b", 3.0, 3.0, 3.0}, {"c", -6.0, -2.8 / 3, 2.0}]
|
|
end
|
|
|
|
test "formatting is correct" do
|
|
src = [{"b", 3.0, 2.91, 4.0}, {"c", -6.0, -2.8 / 3, 2.0}]
|
|
str = Obr.format_results(src)
|
|
assert str == "{b=3.0/3.0/4.0, c=-6.0/-0.9/2.0}"
|
|
end
|
|
end
|