Skip to content

Instantly share code, notes, and snippets.

@TheDudeWithTheThing
Created December 2, 2016 15:58
Show Gist options
  • Save TheDudeWithTheThing/ff8b648268aee905c5d75cb1ff0bc570 to your computer and use it in GitHub Desktop.
Save TheDudeWithTheThing/ff8b648268aee905c5d75cb1ff0bc570 to your computer and use it in GitHub Desktop.
Code.load_file("sky_skraper.exs", __DIR__)
ExUnit.start
defmodule SkySkraperTest do
use ExUnit.Case
test "two coords with overlap" do
assert SkySkraper.area([[11, 14, 2], [12, 13, 5]]) == 9
end
test "two coords no overlap" do
assert SkySkraper.area([[2, 3, 2], [3, 4, 8]]) == 10
end
test "all overlap everywhere" do
assert SkySkraper.area([[2, 3, 2], [2, 3, 8]]) == 8
end
test "one set of coords" do
assert SkySkraper.area([[0, 10, 2]]) == 20
end
test "many sets of coords" do
assert SkySkraper.area( [[0, 10, 3], [3, 5, 7], [6, 7, 8], [9, 11, 2]]) == 45
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment