Assertions are a way of breaking out of code when there is an error or an unexpected input.

Some languages throw exceptions and some treat it as a break point.



Task

Show an assertion in your language by asserting that an integer variable is equal to 42.




ExUnit.start
 
defmodule AssertionTest do
  use ExUnit.Case
 
  def return_5, do: 5
 
  test "not equal" do
    assert 42 == return_5
  end
end