Skip to content

Instantly share code, notes, and snippets.

@sofakingworld
Created March 19, 2019 21:16
Show Gist options
  • Save sofakingworld/21d2ba245278f99f4c307ce9d50803d6 to your computer and use it in GitHub Desktop.
Save sofakingworld/21d2ba245278f99f4c307ce9d50803d6 to your computer and use it in GitHub Desktop.
StackImpTest
defmodule StackImpTest do
use ExUnit.Case
test "pops first item" do
assert {1, [2, 3]} = StackImp.pop([1,2,3])
end
test "pops empty list" do
assert {nil, []} = StackImp.pop([])
end
test "push to empty list" do
assert {[3], [3]} = StackImp.push([], 3)
end
test "push to list begining" do
assert {[0, 1, 2], [0, 1, 2]} = StackImp.push([1, 2], 0)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment