From 25f6804308894613901296a7009cf7721957643d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20B=C3=A4renz?= Date: Tue, 8 Dec 2020 15:35:35 +0100 Subject: [PATCH] DROP? Some test cases --- lib/example/foo.ex | 17 +++++++++++++++++ test/ex_type/checker_test_case.ex | 7 +++++++ 2 files changed, 24 insertions(+) diff --git a/lib/example/foo.ex b/lib/example/foo.ex index 5f422fd..6232557 100644 --- a/lib/example/foo.ex +++ b/lib/example/foo.ex @@ -132,6 +132,16 @@ defmodule ExType.Example.Foo do end end + @spec receive_specific_example() :: integer() + + def receive_specific_example() do + receive do + xs when is_list(xs) -> length(xs) + {_, _} -> 2 + _ -> 0 + end + end + @spec case_example(integer()) :: integer() def case_example(x) do @@ -231,4 +241,11 @@ defmodule ExType.Example.Foo do def add_number(x, y) do x + y end + + @spec function_with_send() :: :foo + + def function_with_send() do + send(self(), "hi") + :foo + end end diff --git a/test/ex_type/checker_test_case.ex b/test/ex_type/checker_test_case.ex index 41aad09..1ccb1b8 100644 --- a/test/ex_type/checker_test_case.ex +++ b/test/ex_type/checker_test_case.ex @@ -61,4 +61,11 @@ defmodule ExType.CheckerTestCase do def get_nested(%Nested{nested: nested}) do nested end + + @spec function_with_send() :: :foo + + def function_with_send() do + send(self(), "hi") + :foo + end end