add .formatter.exs + format
This commit is contained in:
@@ -8,7 +8,7 @@ defmodule AgentTests do
|
||||
"Why hello",
|
||||
"HI THERE",
|
||||
{:multiple, [["Milk"], ["Bread", "Milk"]]},
|
||||
false,
|
||||
false
|
||||
]
|
||||
|
||||
test_all(Agents, answers)
|
||||
|
||||
@@ -9,17 +9,17 @@ defmodule EnumTests do
|
||||
{:multiple, [true, false]},
|
||||
{:multiple, [true, false]},
|
||||
{:multiple, [true, false]},
|
||||
[10,20,30],
|
||||
[1,3],
|
||||
[10, 20, 30],
|
||||
[1, 3],
|
||||
[2],
|
||||
[1,2,3],
|
||||
[1,2,3,4,5],
|
||||
[1,2,3],
|
||||
[1, 2, 3],
|
||||
[1, 2, 3, 4, 5],
|
||||
[1, 2, 3],
|
||||
[a: 1, b: 2, c: 3],
|
||||
2,
|
||||
nil,
|
||||
:no_such_element,
|
||||
6,
|
||||
6
|
||||
]
|
||||
|
||||
test_all(Enums, answers)
|
||||
|
||||
@@ -10,7 +10,7 @@ defmodule EqualitiesTests do
|
||||
2,
|
||||
1,
|
||||
4,
|
||||
2,
|
||||
2
|
||||
]
|
||||
|
||||
test_all(Equalities, answers)
|
||||
|
||||
@@ -7,7 +7,7 @@ defmodule FunctionsTests do
|
||||
"Hello, World!",
|
||||
3,
|
||||
{:multiple, ["One and Two", "Only One"]},
|
||||
{:multiple, ["Hello Hello Hello Hello Hello ","Hello Hello "]},
|
||||
{:multiple, ["Hello Hello Hello Hello Hello ", "Hello Hello "]},
|
||||
{:multiple, [:entire_list, :single_thing]},
|
||||
{:multiple, ["10 is bigger than 5", "4 is not bigger than 27"]},
|
||||
{:multiple, ["The number was zero", "The number was 5"]},
|
||||
@@ -18,7 +18,7 @@ defmodule FunctionsTests do
|
||||
100,
|
||||
1000,
|
||||
"Full Name",
|
||||
{:multiple, ["GOOD", "good"]},
|
||||
{:multiple, ["GOOD", "good"]}
|
||||
]
|
||||
|
||||
test_all(Functions, answers)
|
||||
|
||||
@@ -13,7 +13,7 @@ defmodule GenServersTests do
|
||||
{:error, "Incorrect password!"},
|
||||
"Congrats! Your process was successfully named.",
|
||||
{:ok, "Laptop unlocked!"},
|
||||
{:multiple, ["Laptop unlocked!", "Incorrect password!", "Jack Sparrow"]},
|
||||
{:multiple, ["Laptop unlocked!", "Incorrect password!", "Jack Sparrow"]}
|
||||
]
|
||||
|
||||
test_all(GenServers, answers)
|
||||
|
||||
@@ -8,7 +8,7 @@ defmodule KeywordListsTests do
|
||||
"bar",
|
||||
"baz",
|
||||
{:multiple, [:foo, "bar"]},
|
||||
"foo",
|
||||
"foo"
|
||||
]
|
||||
|
||||
test_all(KeywordLists, answers)
|
||||
|
||||
@@ -3,24 +3,25 @@ defmodule ListsTests do
|
||||
import TestHarness
|
||||
|
||||
test "Lists" do
|
||||
answers = [1,
|
||||
3,
|
||||
[1, 2, :a, "b"],
|
||||
[1,2],
|
||||
[:a, :c],
|
||||
[:a, :b],
|
||||
["life", "life", "life"],
|
||||
[1, 2, 3, 4, 5],
|
||||
[1, 4, 2, 3],
|
||||
[10, 2, 3],
|
||||
[1, 2, 3],
|
||||
[1, 2, 3, 4],
|
||||
[1, 2, 3, 4],
|
||||
{1, 2, 3},
|
||||
["value"],
|
||||
[],
|
||||
["value"],
|
||||
]
|
||||
answers = [
|
||||
1,
|
||||
3,
|
||||
[1, 2, :a, "b"],
|
||||
[1, 2],
|
||||
[:a, :c],
|
||||
[:a, :b],
|
||||
["life", "life", "life"],
|
||||
[1, 2, 3, 4, 5],
|
||||
[1, 4, 2, 3],
|
||||
[10, 2, 3],
|
||||
[1, 2, 3],
|
||||
[1, 2, 3, 4],
|
||||
[1, 2, 3, 4],
|
||||
{1, 2, 3},
|
||||
["value"],
|
||||
[],
|
||||
["value"]
|
||||
]
|
||||
|
||||
test_all(Lists, answers)
|
||||
end
|
||||
|
||||
@@ -14,7 +14,7 @@ defmodule MapSetsTest do
|
||||
false,
|
||||
true,
|
||||
7,
|
||||
[1, 2, 3, 4, 5],
|
||||
[1, 2, 3, 4, 5]
|
||||
]
|
||||
|
||||
test_all(MapSets, answers)
|
||||
|
||||
@@ -13,7 +13,7 @@ defmodule MapsTests do
|
||||
false,
|
||||
%{:first_name => "Jon", :last_name => "Snow"},
|
||||
{:ok, "Baratheon"},
|
||||
%{:first_name => "Jon", :last_name => "Snow"},
|
||||
%{:first_name => "Jon", :last_name => "Snow"}
|
||||
]
|
||||
|
||||
test_all(Maps, answers)
|
||||
|
||||
@@ -30,7 +30,7 @@ defmodule NumbersTests do
|
||||
{:multiple, [6.0, 5.0, 8.9, -5.567]},
|
||||
{:multiple, [1, 10]},
|
||||
{:multiple, [true, true, false]},
|
||||
{:multiple, [true, false]},
|
||||
{:multiple, [true, false]}
|
||||
]
|
||||
|
||||
test_all(Numbers, answers)
|
||||
|
||||
@@ -5,14 +5,14 @@ defmodule PatternsTests do
|
||||
test "Pattern Matching" do
|
||||
answers = [
|
||||
1,
|
||||
{:multiple, [1, [2,3,4]]},
|
||||
[1,2,3,4],
|
||||
{:multiple, [1, [2, 3, 4]]},
|
||||
[1, 2, 3, 4],
|
||||
3,
|
||||
"eggs, milk",
|
||||
"Honda",
|
||||
MatchError,
|
||||
{:multiple, [:make, "Honda"]},
|
||||
[1,2,3],
|
||||
[1, 2, 3],
|
||||
{:multiple, ["Meow", "Woof", "Eh?"]},
|
||||
{:multiple, ["Mickey", "Donald", "I need a name!"]},
|
||||
"dog",
|
||||
|
||||
@@ -18,7 +18,7 @@ defmodule ProcessesTests do
|
||||
{:waited_too_long, "I am impatient"},
|
||||
{:exited, :random_reason},
|
||||
:normal,
|
||||
:normal,
|
||||
:normal
|
||||
]
|
||||
|
||||
test_all(Processes, answers)
|
||||
|
||||
@@ -11,7 +11,7 @@ defmodule SigilsTests do
|
||||
~S(1 + 1 = #{1+1}),
|
||||
["Hello", "world"],
|
||||
["Hello", "123"],
|
||||
["Hello", ~S(#{1+1})],
|
||||
["Hello", ~S(#{1+1})]
|
||||
]
|
||||
|
||||
test_all(Sigils, answers)
|
||||
|
||||
@@ -13,7 +13,7 @@ defmodule StringTests do
|
||||
"banana",
|
||||
"banana",
|
||||
"StringStringString",
|
||||
"LISTEN",
|
||||
"LISTEN"
|
||||
]
|
||||
|
||||
test_all(Strings, answers)
|
||||
|
||||
@@ -11,7 +11,7 @@ defmodule StructsTests do
|
||||
{:ok, 22},
|
||||
%Structs.Airline{plane: %Structs.Plane{maker: :airbus}, name: "Southwest"},
|
||||
%Structs.Airline{plane: %Structs.Plane{maker: :boeing, passengers: 202}, name: "Southwest"},
|
||||
%{plane: %{maker: :cessna}, name: "Southwest"},
|
||||
%{plane: %{maker: :cessna}, name: "Southwest"}
|
||||
]
|
||||
|
||||
test_all(Structs, answers)
|
||||
|
||||
@@ -9,8 +9,8 @@ defmodule TasksTests do
|
||||
nil,
|
||||
false,
|
||||
9,
|
||||
[1,4,9,16],
|
||||
]
|
||||
[1, 4, 9, 16]
|
||||
]
|
||||
|
||||
test_all(Tasks, answers)
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@ defmodule TupleTests do
|
||||
{:a, :new_thing, "hi"},
|
||||
{"Huey", "Dewey", "Louie"},
|
||||
{:this, :is, :awesome},
|
||||
[:this, :can, :be, :a, :list],
|
||||
[:this, :can, :be, :a, :list]
|
||||
]
|
||||
|
||||
test_all(Tuples, answers)
|
||||
|
||||
Reference in New Issue
Block a user