Created
March 19, 2019 21:16
-
-
Save sofakingworld/21d2ba245278f99f4c307ce9d50803d6 to your computer and use it in GitHub Desktop.
StackImpTest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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