Possible bug in doctests

31 views
Skip to first unread message

eksperimental

unread,
May 28, 2017, 8:55:32 PM5/28/17
to elixir-l...@googlegroups.com
Working in the latests addition to doctests let me found this bug,
This is an actual test,

defmodule ExUnit.DocTestTest.Incomplete do
@doc ~S'''
iex> 1 + 2

'''
def test_fun, do: :ok
end

it fails because there is nothing to evaluate against at the end of the doctest,
But I see that we have the assumption that all the tests finish in a new lines (because we use the
HEREDOC comments and they always end in a new line).

but the following code will compile, when it shouldn't

defmodule ExUnit.DocTestTest.Incomplete do
@doc "
iex> 1 + 2"
def test_fun, do: :ok
end


Correct me if I'm wrong.

José Valim

unread,
May 29, 2017, 2:34:34 AM5/29/17
to elixir-l...@googlegroups.com
Yes, I would say that it is incomplete.

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/20170529075502.11c3bced.eksperimental%40autistici.org.
For more options, visit https://groups.google.com/d/optout.
--


José Valim
Skype: jv.ptec
Founder and Director of R&D

eksperimental

unread,
May 29, 2017, 10:26:09 AM5/29/17
to elixir-l...@googlegroups.com
I will submit a PR then
Reply all
Reply to author
Forward
0 new messages