A PR would be great, thank you! I have already dropped some comments in the
commit. :)

On Fri, Mar 4, 2022 at 10:43 AM Rudolf Manusadzhian <rud.manusa...@gmail.com>
wrote:

> Hi there! I faced a behaviour when in *doctest* we pass option *:only*
> with the functions to test, but the module actually doesn't have those
> functions listed publicly - doctest just gets ignored and doesn't even
> report about that.
>
> The issue is, if I rename the function but forget to update its docs and
> doctest - the whole will not point that out but rather just pass with less
> tests. And leaves me with outdated and non tested docs.
>
> The small example:
>
> defmodule DoctestOnly do
> @doc """ Hello world. ## Examples iex> DoctestOnly.hello() :world """ def
> *foo* do :world end
> end
>
> and the test
>
> defmodule DoctestOnlyTest do use ExUnit.Case doctest DoctestOnly, only: [
> *hello*: 0] end
>
> I would expect test to crash with some message like "function 
> DoctestOnly.hello/0
> is undefined or private"
>
> I put up together a commit that somewhat solves the issue for me. Not sure
> if it's desirable, though:
>
>
> https://github.com/elixir-lang/elixir/commit/5c89ef573a935c0f6db616c9f439298507263ac1
>
> --
> 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-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/a8060300-4176-4d59-a444-cf08daa701d5n%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/a8060300-4176-4d59-a444-cf08daa701d5n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2BL%2B04pyWPi6BX40xJdipLub2LV7F8KqskF_fMECd-HtA%40mail.gmail.com.

Reply via email to