Skip to content

Commit

Permalink
Test more undef/not_exported error cases
Browse files Browse the repository at this point in the history
  • Loading branch information
erszcz committed Feb 15, 2022
1 parent 4ba80a9 commit 1250c87
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
16 changes: 12 additions & 4 deletions priv/test/undefined_errors_helper.erl
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
-module(undefined_errors_helper).
-export([und_rec/0, und_ty/0, not_exp_ty/0]).
-export_type([j/0]).
-export_type([j/0,
expands_to_undefined_remote/0,
expands_to_struct_with_undefined_remote/0,
expands_to_struct_with_undefined_local/0,
expands_to_struct_with_undefined_record/0]).

-type j() :: undefined_type().
-type j() :: undefined_type1().
-type not_exported() :: ok.
-type expands_to_undefined_remote() :: undefined_errors:undefined_type2().
-type expands_to_struct_with_undefined_remote() :: {struct, undefined_errors:undefined_type3()}.
-type expands_to_struct_with_undefined_local() :: {struct, undefined_type4()}.
-type expands_to_struct_with_undefined_record() :: {struct, #undefined_record1{}}.

-spec und_rec() -> #undefined_record{}.
-spec und_rec() -> #undefined_record2{}.
und_rec() -> ok.

-spec und_ty() -> undefined_errors:undefined_type().
-spec und_ty() -> undefined_errors:undefined_type5().
und_ty() -> ok.

-spec not_exp_ty() -> not_exported().
Expand Down
16 changes: 16 additions & 0 deletions test/misc/undefined_errors.erl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
-module(undefined_errors).
-export([remote_type/0,
remote_remote_type/0,
remote_struct_with_remote_type/0,
remote_struct_with_local_type/0,
remote_struct_with_record/0,
remote_call/0,
remote_record/0,
normalize_remote_type/0,
Expand All @@ -8,6 +12,18 @@
-spec remote_type() -> undefined_errors_helper:j().
remote_type() -> ok.

-spec remote_remote_type() -> undefined_errors_helper:expands_to_undefined_remote().
remote_remote_type() -> ok.

-spec remote_struct_with_remote_type() -> undefined_errors_helper:expands_to_struct_with_undefined_remote().
remote_struct_with_remote_type() -> {struct, ok}.

-spec remote_struct_with_local_type() -> undefined_errors_helper:expands_to_struct_with_undefined_local().
remote_struct_with_local_type() -> {struct, ok}.

-spec remote_struct_with_record() -> undefined_errors_helper:expands_to_struct_with_undefined_record().
remote_struct_with_record() -> {struct, ok}.

-spec remote_call() -> ok.
remote_call() -> undefined_errors_helper:undefined_call().

Expand Down

0 comments on commit 1250c87

Please sign in to comment.