Skip to content

Commit c1758b3

Browse files
committed
examples: update example output
1 parent 3f94ada commit c1758b3

File tree

1 file changed

+26
-3
lines changed
  • examples/practical.t

1 file changed

+26
-3
lines changed

examples/practical.t/run.t

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,33 @@
1313
Warning 8: this pattern-matching is not exhaustive.
1414
Here is an example of a case that is not matched:
1515
Error _
16-
Compiling gen_tcp.erl OK
16+
Compiling gen_tcp_types.erl OK
1717
Compiling echo.erl OK
1818
$ cat gen_tcp.erl
19+
cat: gen_tcp.erl: No such file or directory
20+
[1]
1921
$ cat gen_tcp_types.erl
22+
% Source code generated with Caramel.
23+
-module(gen_tcp_types).
24+
-export_type([connection/0]).
25+
-export_type([listen_opt/0]).
26+
-export_type([packet/0]).
27+
-export_type([socket/0]).
28+
29+
30+
-opaque socket() :: reference().
31+
32+
-opaque connection() :: reference().
33+
34+
-type packet() :: http
35+
| line
36+
.
37+
38+
-type listen_opt() :: {active, boolean()}
39+
| {packet, packet()}
40+
.
41+
42+
2043
$ cat echo.erl
2144
% Source code generated with Caramel.
2245
-module(echo).
@@ -25,12 +48,12 @@
2548
-export([loop/1]).
2649
-export([start/1]).
2750

28-
-spec handle(gen_tcp:connection()) -> ok.
51+
-spec handle(gen_tcp_types:connection()) -> ok.
2952
handle(Conn) ->
3053
gen_tcp:send(Conn, <<"hello world">>),
3154
gen_tcp:close(Conn).
3255

33-
-spec loop(gen_tcp:socket()) -> any().
56+
-spec loop(gen_tcp_types:socket()) -> any().
3457
loop(Socket) ->
3558
case gen_tcp:accept(Socket) of
3659
{ok, Conn} -> Handler = process:make(fun

0 commit comments

Comments
 (0)