diff options
Diffstat (limited to 'lib/dialyzer/test/opaque_tests_SUITE_data/src/rec')
-rw-r--r-- | lib/dialyzer/test/opaque_tests_SUITE_data/src/rec/rec_adt.erl | 22 | ||||
-rw-r--r-- | lib/dialyzer/test/opaque_tests_SUITE_data/src/rec/rec_use.erl | 30 |
2 files changed, 0 insertions, 52 deletions
diff --git a/lib/dialyzer/test/opaque_tests_SUITE_data/src/rec/rec_adt.erl b/lib/dialyzer/test/opaque_tests_SUITE_data/src/rec/rec_adt.erl deleted file mode 100644 index f01cc5e519..0000000000 --- a/lib/dialyzer/test/opaque_tests_SUITE_data/src/rec/rec_adt.erl +++ /dev/null @@ -1,22 +0,0 @@ --module(rec_adt). - --export([new/0, get_a/1, get_b/1, set_a/2, set_b/2]). - --record(rec, {a :: atom(), b = 0 :: integer()}). - --opaque rec() :: #rec{}. - --spec new() -> rec(). -new() -> #rec{a = gazonk, b = 42}. - --spec get_a(rec()) -> atom(). -get_a(#rec{a = A}) -> A. - --spec get_b(rec()) -> integer(). -get_b(#rec{b = B}) -> B. - --spec set_a(rec(), atom()) -> rec(). -set_a(R, A) -> R#rec{a = A}. - --spec set_b(rec(), integer()) -> rec(). -set_b(R, B) -> R#rec{b = B}. diff --git a/lib/dialyzer/test/opaque_tests_SUITE_data/src/rec/rec_use.erl b/lib/dialyzer/test/opaque_tests_SUITE_data/src/rec/rec_use.erl deleted file mode 100644 index 358e9f918c..0000000000 --- a/lib/dialyzer/test/opaque_tests_SUITE_data/src/rec/rec_use.erl +++ /dev/null @@ -1,30 +0,0 @@ --module(rec_use). - --export([ok1/0, ok2/0, wrong1/0, wrong2/0, wrong3/0, wrong4/0]). - -ok1() -> - rec_adt:set_a(rec_adt:new(), foo). - -ok2() -> - R1 = rec_adt:new(), - B1 = rec_adt:get_b(R1), - R2 = rec_adt:set_b(R1, 42), - B2 = rec_adt:get_b(R2), - B1 =:= B2. - -wrong1() -> - case rec_adt:new() of - {rec, _, 42} -> weird1; - R when tuple_size(R) =:= 3 -> weird2 - end. - -wrong2() -> - R = list_to_tuple([rec, a, 42]), - rec_adt:get_a(R). - -wrong3() -> - R = rec_adt:new(), - R =:= {rec, gazonk, 42}. - -wrong4() -> - tuple_size(rec_adt:new()). |