Remove arithmetic koans
This commit is contained in:
@@ -5,6 +5,10 @@ defmodule Equalities do
|
|||||||
assert true == :__
|
assert true == :__
|
||||||
end
|
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
|
koan "To understand reality, we must compare our expectations against reality" do
|
||||||
assert 2 == 1 + :__
|
assert 2 == 1 + :__
|
||||||
end
|
end
|
||||||
@@ -13,11 +17,15 @@ defmodule Equalities do
|
|||||||
assert 1 == 2 / :__
|
assert 1 == 2 / :__
|
||||||
end
|
end
|
||||||
|
|
||||||
koan "Something is not equal to nothing" do
|
koan "Unless they actually are different" do
|
||||||
assert !(:__ == nil)
|
assert 3.2 != :__
|
||||||
end
|
end
|
||||||
|
|
||||||
koan "When things cannot be equal, they must be different" do
|
koan "Some may be looking for bigger things" do
|
||||||
refute :__ == 4
|
assert :__ > 3
|
||||||
|
end
|
||||||
|
|
||||||
|
koan "Others are happy with less" do
|
||||||
|
assert :__ < 3
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
defmodule Runner do
|
defmodule Runner do
|
||||||
@modules [
|
@modules [
|
||||||
Equalities,
|
Equalities,
|
||||||
Arithmetic,
|
|
||||||
Strings,
|
Strings,
|
||||||
Tuples,
|
Tuples,
|
||||||
Lists,
|
Lists,
|
||||||
|
|||||||
@@ -2,31 +2,17 @@ defmodule KoansHarnessTest do
|
|||||||
use ExUnit.Case
|
use ExUnit.Case
|
||||||
|
|
||||||
test "Equalities" do
|
test "Equalities" do
|
||||||
answers = [true,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
1,
|
|
||||||
:something]
|
|
||||||
|
|
||||||
test_all(Equalities, answers)
|
|
||||||
end
|
|
||||||
|
|
||||||
test "Arithmetic" do
|
|
||||||
answers = [
|
answers = [
|
||||||
4,
|
true,
|
||||||
3,
|
false,
|
||||||
12,
|
1,
|
||||||
3,
|
|
||||||
3,
|
|
||||||
2.5,
|
|
||||||
2,
|
2,
|
||||||
1,
|
1,
|
||||||
4,
|
4,
|
||||||
1,
|
|
||||||
2
|
2
|
||||||
]
|
]
|
||||||
|
|
||||||
test_all(Arithmetic, answers)
|
test_all(Equalities, answers)
|
||||||
end
|
end
|
||||||
|
|
||||||
test "Strings" do
|
test "Strings" do
|
||||||
|
|||||||
Reference in New Issue
Block a user