-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_debug_show.expected.ml
202 lines (202 loc) · 9.03 KB
/
test_debug_show.expected.ml
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
module Debug_runtime = (val
Minidebug_runtime.debug_flushing ~filename:"debugger_show_flushing" ())
let foo (x : int) =
(let __entry_id = Debug_runtime.get_entry_id () in
();
(Debug_runtime.open_log ~fname:"test_debug_show.ml" ~start_lnum:4
~start_colnum:19 ~end_lnum:6 ~end_colnum:17 ~message:"foo"
~entry_id:__entry_id ~log_level:1 `Debug;
Debug_runtime.log_value_show ?descr:(Some "x") ~entry_id:__entry_id
~log_level:1 ~is_result:false (([%show : int]) x));
(match let y : int =
let __entry_id = Debug_runtime.get_entry_id () in
();
Debug_runtime.open_log ~fname:"test_debug_show.ml" ~start_lnum:5
~start_colnum:6 ~end_lnum:5 ~end_colnum:7 ~message:"y"
~entry_id:__entry_id ~log_level:1 `Debug;
(match x + 1 with
| y as __res ->
((();
Debug_runtime.log_value_show ?descr:(Some "y")
~entry_id:__entry_id ~log_level:1 ~is_result:true
(([%show : int]) y));
Debug_runtime.close_log ~fname:"test_debug_show.ml"
~start_lnum:5 ~entry_id:__entry_id;
__res)
| exception e ->
(Debug_runtime.close_log ~fname:"test_debug_show.ml"
~start_lnum:5 ~entry_id:__entry_id;
raise e)) in
[x; y; 2 * y]
with
| __res ->
(Debug_runtime.log_value_show ?descr:(Some "foo")
~entry_id:__entry_id ~log_level:1 ~is_result:true
(([%show : int list]) __res);
Debug_runtime.close_log ~fname:"test_debug_show.ml" ~start_lnum:4
~entry_id:__entry_id;
__res)
| exception e ->
(Debug_runtime.close_log ~fname:"test_debug_show.ml" ~start_lnum:4
~entry_id:__entry_id;
raise e)) : int list)
let () = ignore @@ (List.hd @@ (foo 7))
type t = {
first: int ;
second: int }[@@deriving show]
let bar (x : t) =
(let __entry_id = Debug_runtime.get_entry_id () in
();
(Debug_runtime.open_log ~fname:"test_debug_show.ml" ~start_lnum:12
~start_colnum:19 ~end_lnum:14 ~end_colnum:14 ~message:"bar"
~entry_id:__entry_id ~log_level:1 `Debug;
Debug_runtime.log_value_show ?descr:(Some "x") ~entry_id:__entry_id
~log_level:1 ~is_result:false (([%show : t]) x));
(match let y : int =
let __entry_id = Debug_runtime.get_entry_id () in
();
Debug_runtime.open_log ~fname:"test_debug_show.ml" ~start_lnum:13
~start_colnum:6 ~end_lnum:13 ~end_colnum:7 ~message:"y"
~entry_id:__entry_id ~log_level:1 `Debug;
(match x.first + 1 with
| y as __res ->
((();
Debug_runtime.log_value_show ?descr:(Some "y")
~entry_id:__entry_id ~log_level:1 ~is_result:true
(([%show : int]) y));
Debug_runtime.close_log ~fname:"test_debug_show.ml"
~start_lnum:13 ~entry_id:__entry_id;
__res)
| exception e ->
(Debug_runtime.close_log ~fname:"test_debug_show.ml"
~start_lnum:13 ~entry_id:__entry_id;
raise e)) in
x.second * y
with
| __res ->
(Debug_runtime.log_value_show ?descr:(Some "bar")
~entry_id:__entry_id ~log_level:1 ~is_result:true
(([%show : int]) __res);
Debug_runtime.close_log ~fname:"test_debug_show.ml" ~start_lnum:12
~entry_id:__entry_id;
__res)
| exception e ->
(Debug_runtime.close_log ~fname:"test_debug_show.ml" ~start_lnum:12
~entry_id:__entry_id;
raise e)) : int)
let () = ignore @@ (bar { first = 7; second = 42 })
let baz (x : t) =
(let __entry_id = Debug_runtime.get_entry_id () in
();
(Debug_runtime.open_log ~fname:"test_debug_show.ml" ~start_lnum:18
~start_colnum:19 ~end_lnum:20 ~end_colnum:20 ~message:"baz"
~entry_id:__entry_id ~log_level:1 `Debug;
Debug_runtime.log_value_show ?descr:(Some "x") ~entry_id:__entry_id
~log_level:1 ~is_result:false (([%show : t]) x));
(match let (((y, z) as _yz) : (int * int)) =
let __entry_id = Debug_runtime.get_entry_id () in
();
Debug_runtime.open_log ~fname:"test_debug_show.ml" ~start_lnum:19
~start_colnum:17 ~end_lnum:19 ~end_colnum:20 ~message:"_yz"
~entry_id:__entry_id ~log_level:1 `Debug;
(match ((x.first + 1), 3) with
| _yz as __res ->
((();
Debug_runtime.log_value_show ?descr:(Some "_yz")
~entry_id:__entry_id ~log_level:1 ~is_result:true
(([%show : (int * int)]) _yz));
Debug_runtime.close_log ~fname:"test_debug_show.ml"
~start_lnum:19 ~entry_id:__entry_id;
__res)
| exception e ->
(Debug_runtime.close_log ~fname:"test_debug_show.ml"
~start_lnum:19 ~entry_id:__entry_id;
raise e)) in
(x.second * y) + z
with
| __res ->
(Debug_runtime.log_value_show ?descr:(Some "baz")
~entry_id:__entry_id ~log_level:1 ~is_result:true
(([%show : int]) __res);
Debug_runtime.close_log ~fname:"test_debug_show.ml" ~start_lnum:18
~entry_id:__entry_id;
__res)
| exception e ->
(Debug_runtime.close_log ~fname:"test_debug_show.ml" ~start_lnum:18
~entry_id:__entry_id;
raise e)) : int)
let () = ignore @@ (baz { first = 7; second = 42 })
let rec loop (depth : int) (x : t) =
(let __entry_id = Debug_runtime.get_entry_id () in
();
((Debug_runtime.open_log ~fname:"test_debug_show.ml" ~start_lnum:24
~start_colnum:24 ~end_lnum:30 ~end_colnum:9 ~message:"loop"
~entry_id:__entry_id ~log_level:1 `Debug;
Debug_runtime.log_value_show ?descr:(Some "depth") ~entry_id:__entry_id
~log_level:1 ~is_result:false (([%show : int]) depth));
Debug_runtime.log_value_show ?descr:(Some "x") ~entry_id:__entry_id
~log_level:1 ~is_result:false (([%show : t]) x));
(match if depth > 6
then x.first + x.second
else
if depth > 3
then
loop (depth + 1)
{ first = (x.second + 1); second = (x.first / 2) }
else
(let y : int =
let __entry_id = Debug_runtime.get_entry_id () in
();
Debug_runtime.open_log ~fname:"test_debug_show.ml"
~start_lnum:28 ~start_colnum:8 ~end_lnum:28 ~end_colnum:9
~message:"y" ~entry_id:__entry_id ~log_level:1 `Debug;
(match loop (depth + 1)
{ first = (x.second - 1); second = (x.first + 2) }
with
| y as __res ->
((();
Debug_runtime.log_value_show ?descr:(Some "y")
~entry_id:__entry_id ~log_level:1 ~is_result:true
(([%show : int]) y));
Debug_runtime.close_log ~fname:"test_debug_show.ml"
~start_lnum:28 ~entry_id:__entry_id;
__res)
| exception e ->
(Debug_runtime.close_log ~fname:"test_debug_show.ml"
~start_lnum:28 ~entry_id:__entry_id;
raise e)) in
let z : int =
let __entry_id = Debug_runtime.get_entry_id () in
();
Debug_runtime.open_log ~fname:"test_debug_show.ml"
~start_lnum:29 ~start_colnum:8 ~end_lnum:29 ~end_colnum:9
~message:"z" ~entry_id:__entry_id ~log_level:1 `Debug;
(match loop (depth + 1)
{ first = (x.second + 1); second = y }
with
| z as __res ->
((();
Debug_runtime.log_value_show ?descr:(Some "z")
~entry_id:__entry_id ~log_level:1 ~is_result:true
(([%show : int]) z));
Debug_runtime.close_log ~fname:"test_debug_show.ml"
~start_lnum:29 ~entry_id:__entry_id;
__res)
| exception e ->
(Debug_runtime.close_log ~fname:"test_debug_show.ml"
~start_lnum:29 ~entry_id:__entry_id;
raise e)) in
z + 7)
with
| __res ->
(Debug_runtime.log_value_show ?descr:(Some "loop")
~entry_id:__entry_id ~log_level:1 ~is_result:true
(([%show : int]) __res);
Debug_runtime.close_log ~fname:"test_debug_show.ml" ~start_lnum:24
~entry_id:__entry_id;
__res)
| exception e ->
(Debug_runtime.close_log ~fname:"test_debug_show.ml" ~start_lnum:24
~entry_id:__entry_id;
raise e)) : int)
let () = ignore @@ (loop 0 { first = 7; second = 42 })