defmodule BinaryExampleTest do
  use ExUnit.Case

  test "binary is compiled" do
    bins = ~w(binary_example hello_rust)

    for bin <- bins do
      assert_exists(bin)
    end
  end

  defp assert_exists(name) do
    assert_exists(name, :os.type())
  end

  defp assert_exists(name, {:win32, _} = _type) do
    assert File.exists?("priv/native/#{name}.exe")
  end

  defp assert_exists(name, _type) do
    assert File.exists?("priv/native/#{name}")
  end
end
