Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Commit

Permalink
Split fixtures into meta and links modules
Browse files Browse the repository at this point in the history
  • Loading branch information
erszcz committed Aug 19, 2020
1 parent 912639c commit c28c68a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 29 deletions.
14 changes: 7 additions & 7 deletions test/eep48_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -77,36 +77,36 @@ edoc_app_should_pass_shell_docs_validation(Config) ->
[ shell_docs:validate(M) || M <- Modules ].

function_since_tag(Config) ->
Docs = get_docs(Config, eep48_SUITE_fixtures),
Docs = get_docs(Config, eep48_meta),
%?debugVal(Docs, 1000),
?assertEqual(<<"0.1.0">>, get_function_meta_field(since, fun_with_since_tag, 0, Docs) ).

function_deprecated_tag(Config) ->
Docs = get_docs(Config, eep48_SUITE_fixtures),
Docs = get_docs(Config, eep48_meta),
%?debugVal(Docs, 1000),
?assertEqual(<<"Deprecated function.">>,
get_function_meta_field(deprecated, fun_with_deprecated_tag, 0, Docs) ).

type_since_tag(Config) ->
Docs = get_docs(Config, eep48_SUITE_fixtures),
Docs = get_docs(Config, eep48_meta),
%?debugVal(Docs, 1000),
?assertEqual(<<"0.1.0">>, get_type_meta_field(since, type_with_since_tag, 0, Docs) ).

type_deprecated_tag(Config) ->
Docs = get_docs(Config, eep48_SUITE_fixtures),
Docs = get_docs(Config, eep48_meta),
%?debugVal(Docs, 1000),
?assertEqual(<<"Deprecated type.">>,
get_type_meta_field(deprecated, type_with_deprecated_tag, 0, Docs) ).

cb_since_tag(Config) ->
Docs = get_docs(Config, eep48_SUITE_fixtures),
Docs = get_docs(Config, eep48_meta),
%?debugVal(Docs, 1000),
?assertEqual(<<"0.1.0">>,
get_type_meta_field(since, cb_with_since_tag, 0, Docs) ).

cb_deprecated_tag(Config) ->
Docs = get_docs(Config, eep48_SUITE_fixtures),
?debugVal(Docs, 1000),
Docs = get_docs(Config, eep48_meta),
%?debugVal(Docs, 1000),
?assertEqual(<<"Deprecated callback.">>,
get_type_meta_field(deprecated, cb_with_deprecated_tag, 0, Docs) ).

Expand Down
25 changes: 25 additions & 0 deletions test/eep48_SUITE_data/eep48_links.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-module(eep48_links).

-export([module_link/0,
app_link/0,
app_module_link/0,
app_mfa_link/0,
external_function_link/0,
local_function_link/0]).

module_link() -> ok.

%% @doc Link to application {@link //edoc}.
app_link() -> ok.

%% @doc Link to application module {@link //edoc/edoc_doclet}.
app_module_link() -> ok.

%% @doc Link to application M:F/A {@link //edoc/edoc:files/2}.
app_mfa_link() -> ok.

%% @doc Link to external function {@link eep48_SUITE:suite/0}.
external_function_link() -> ok.

%% @doc Link to local function {@link f/0}.
local_function_link() -> ok.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
-module(eep48_SUITE_fixtures).
-module(eep48_meta).

-export([f/0,
fun_with_deprecated_tag/0,
-export([fun_with_deprecated_tag/0,
fun_with_since_tag/0]).

-export_type([type_with_deprecated_tag/0,
Expand Down Expand Up @@ -34,22 +33,3 @@ fun_with_deprecated_tag() -> ok.

%% @since 0.1.0
fun_with_since_tag() -> ok.

f() -> ok.

module_link() -> ok.

%% @doc Link to application {@link //edoc}.
app_link() -> ok.

%% @doc Link to application module {@link //edoc/edoc_doclet}.
app_module_link() -> ok.

%% @doc Link to application M:F/A {@link //edoc/edoc:files/2}.
app_mfa_link() -> ok.

%% @doc Link to external function {@link eep48_SUITE:suite/0}.
external_function_link() -> ok.

%% @doc Link to local function {@link f/0}.
local_function_link() -> ok.

0 comments on commit c28c68a

Please sign in to comment.