Skip to content

Commit

Permalink
Fix doctests
Browse files Browse the repository at this point in the history
The `...>` notation is reserved for multiline expressions. If the
previous expression is intended to be ignored, then no changes in
the syntax are required.

This resolves a number of warnings about unused literals and
causes some missed tests to be run correctly.
  • Loading branch information
QuinnWilton committed Jan 24, 2022
1 parent fd2fbf3 commit 594cf60
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/witchcraft/foldable.ex
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ defclass Witchcraft.Foldable do
## Examples
iex> sum = fn xs -> right_fold(xs, 0, &+/2) end
...> sum.([1, 2, 3])
iex> sum.([1, 2, 3])
6
...> sum.([4, 5, 6])
iex> sum.([4, 5, 6])
15
"""
Expand Down Expand Up @@ -120,9 +120,9 @@ defclass Witchcraft.Foldable do
## Examples
iex> sum = fn xs -> right_fold(xs, 0, &+/2) end
...> sum.([1, 2, 3])
iex> sum.([1, 2, 3])
6
...> sum.([4, 5, 6])
iex> sum.([4, 5, 6])
15
iex> left_fold([1, 2, 3], [], fn(acc, x) -> [x | acc] end)
Expand Down Expand Up @@ -265,7 +265,7 @@ defclass Witchcraft.Foldable do
## Examples
iex> use Witchcraft.Foldable
...> length(%{})
iex> length(%{})
0
iex> length(%{a: 1, b: 2})
2
Expand Down Expand Up @@ -356,9 +356,9 @@ defclass Witchcraft.Foldable do
## Examples
iex> use Witchcraft.Foldable
...> max([2, 3, 1])
iex> max([2, 3, 1])
3
...> max([[4], [1, 2, 3, 4]])
iex> max([[4], [1, 2, 3, 4]])
[4]
%BinaryTree{
Expand Down Expand Up @@ -414,9 +414,9 @@ defclass Witchcraft.Foldable do
## Examples
iex> use Witchcraft.Foldable
...> min([2, 3, 1])
iex> min([2, 3, 1])
1
...> min([[4], [1, 2, 3, 4]])
iex> min([[4], [1, 2, 3, 4]])
[1, 2, 3, 4]
%BinaryTree{
Expand Down Expand Up @@ -614,7 +614,7 @@ defclass Witchcraft.Foldable do
## Examples
iex> import Integer
...> all?([1, 2, 3], &is_odd/1)
iex> all?([1, 2, 3], &is_odd/1)
false
%BinaryTree{
Expand Down Expand Up @@ -668,7 +668,7 @@ defclass Witchcraft.Foldable do
## Examples
iex> require Integer
...> any?([1, 2, 3], &Integer.is_odd/1)
iex> any?([1, 2, 3], &Integer.is_odd/1)
true
%BinaryTree{
Expand Down

0 comments on commit 594cf60

Please sign in to comment.