Remove arithmetic koans

This commit is contained in:
Uku Taht
2016-04-18 13:31:32 +01:00
parent 128188cc68
commit 452aa5d9ee
15 changed files with 16 additions and 74 deletions

View File

@@ -5,6 +5,10 @@ defmodule Equalities do
assert true == :__
end
koan "Not something is the opposite of it" do
assert !true == :__
end
koan "To understand reality, we must compare our expectations against reality" do
assert 2 == 1 + :__
end
@@ -13,11 +17,15 @@ defmodule Equalities do
assert 1 == 2 / :__
end
koan "Something is not equal to nothing" do
assert !(:__ == nil)
koan "Unless they actually are different" do
assert 3.2 != :__
end
koan "When things cannot be equal, they must be different" do
refute :__ == 4
koan "Some may be looking for bigger things" do
assert :__ > 3
end
koan "Others are happy with less" do
assert :__ < 3
end
end

View File

@@ -1,51 +0,0 @@
defmodule Arithmetic do
use Koans
koan "It can add numbers" do
assert 3 + :__ == 7
end
koan "It can substract numbers" do
assert 7 - 4 == :__
end
koan "It can multiply" do
assert 3 * 4 == :__
end
koan "Floats and integers can be equal..." do
assert 3.0 == :__
end
koan "...unless they are not precisely the same" do
assert 3.2 != :__
end
koan "It does floating point division" do
assert 5 / 2 == :__
end
koan "It does integer division" do
numerator = 5
denominator = 2
assert div(numerator, denominator) == :__
end
koan "It calculates the remainder of a division" do
numerator = 5
denominator = 2
assert rem(numerator, denominator) == :__
end
koan "It finds the maximum in a list" do
assert Enum.max([1,2,3,4]) == :__
end
koan "It finds the minimum in a list" do
assert Enum.min([1,2,3,4]) == :__
end
koan "It can compare numbers" do
assert 5 > :__
end
end

View File

@@ -1,7 +1,6 @@
defmodule Runner do
@modules [
Equalities,
Arithmetic,
Strings,
Tuples,
Lists,

View File

@@ -2,31 +2,17 @@ defmodule KoansHarnessTest do
use ExUnit.Case
test "Equalities" do
answers = [true,
1,
2,
1,
:something]
test_all(Equalities, answers)
end
test "Arithmetic" do
answers = [
4,
3,
12,
3,
3,
2.5,
true,
false,
1,
2,
1,
4,
1,
2
]
test_all(Arithmetic, answers)
test_all(Equalities, answers)
end
test "Strings" do