aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edoc/test/edoc_SUITE_data
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2013-11-07 15:27:56 +0100
committerBjörn-Egil Dahlberg <[email protected]>2014-01-28 17:06:41 +0100
commit40706594b498291d57528ccb3e966febccb959b7 (patch)
treef468497e0cb8bba2e4a1cc404f488b79f565506a /lib/edoc/test/edoc_SUITE_data
parentb42453915e4c6aa1133e88c06a60dfbc5fe5e1f0 (diff)
downloadotp-40706594b498291d57528ccb3e966febccb959b7.tar.gz
otp-40706594b498291d57528ccb3e966febccb959b7.tar.bz2
otp-40706594b498291d57528ccb3e966febccb959b7.zip
edoc: Add test for Maps in EDoc
Diffstat (limited to 'lib/edoc/test/edoc_SUITE_data')
-rw-r--r--lib/edoc/test/edoc_SUITE_data/map_module.erl27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/edoc/test/edoc_SUITE_data/map_module.erl b/lib/edoc/test/edoc_SUITE_data/map_module.erl
new file mode 100644
index 0000000000..94ee7e6f26
--- /dev/null
+++ b/lib/edoc/test/edoc_SUITE_data/map_module.erl
@@ -0,0 +1,27 @@
+-module(map_module).
+
+-export([foo1/1,foo2/3]).
+
+%% @type wazzup() = integer()
+%% @type some_type() = map()
+%% @type some_other_type() = {a, #{ list() => term()}}
+
+-type some_type() :: map().
+-type some_other_type() :: {'a', #{ list() => term()} }.
+-type wazzup() :: integer().
+
+-spec foo1(Map :: #{ 'a' => integer(), 'b' => term()}) -> term().
+
+%% @doc Gets value from map.
+
+foo1(#{ a:= 1, b := V}) -> V.
+
+%% @spec foo2(some_type(), Type2 :: some_other_type(), map()) -> Value
+%% @doc Gets value from map.
+
+-spec foo2(
+ Type1 :: some_type(),
+ Type2 :: some_other_type(),
+ Map :: #{ get => 'value', 'value' => binary()}) -> binary().
+
+foo2(Type1, {a,#{ "a" := _}}, #{get := value, value := B}) when is_map(Type1) -> B.