Skip to content

Conversation

@williamthome
Copy link
Owner

@williamthome williamthome commented Feb 17, 2025

This PR deprecates the -doctest attribute to simplify the API, reduce lib maintenance, and give more control over the tests.

This is no longer valid:

-ifdef(TEST).
% The doctest header sets `doctest_transform` as a parse_transform:
-include_lib("doctest/include/doctest.hrl").
-doctest #{
    % Options
}.
-endif.

Instead, do this:

-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").

% The EUnit header will automatically export this function because it ends with "_test"
doctest_test() ->
    doctest:module(?MODULE, #{
        % Options
    }).
-endif.

@williamthome williamthome merged commit 554855a into main Feb 17, 2025
4 checks passed
@williamthome williamthome deleted the feat/new-api branch February 17, 2025 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants