blob: cbb451196cdde8e13bff3ef71dd4b955b8ba74d9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
%% -*- erlang-indent-level: 2 -*-
%%%-------------------------------------------------------------------
%%% Author: Kostis Sagonas
%%%
%%% Contains tests that manipulate and pattern match against records.
%%%-------------------------------------------------------------------
-module(basic_records).
-export([test/0]).
test() ->
ok = test_rec1(),
ok.
%%--------------------------------------------------------------------
-record(r, {ra}).
-record(s, {sa, sb, sc, sd}).
test_rec1() ->
R = #r{},
S = #s{},
S1 = S#s{sc=R, sd=1},
R1 = S1#s.sc,
undefined = R1#r.ra,
ok.
%%--------------------------------------------------------------------
|