Skip to content

Commit

Permalink
Formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukstafi committed Sep 8, 2024
1 parent 688e2d3 commit 5c62e96
Show file tree
Hide file tree
Showing 8 changed files with 966 additions and 980 deletions.
3 changes: 2 additions & 1 deletion minidebug_runtime.mli
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ module type PrintBox_runtime = sig
editor-specific prefixes such as ["vscode://file/"].
Note that rendering a link on a node will make the node non-foldable,
therefore it is best to combine [`Prefix prefix] with [values_first_mode=true]. *)
therefore it is best to combine [`Prefix prefix] with
[values_first_mode=true]. *)
mutable toc_specific_hyperlink : string option;
(** If provided, overrides [hyperlink] as the prefix used for generating URIs
pointing to anchors in logs. *)
Expand Down
68 changes: 34 additions & 34 deletions test/debugger_sexp_md.expected.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,91 +2,91 @@
BEGIN DEBUG SESSION
<details><summary><a id="1"></a> &nbsp; <code>foo = (7 8 16)</code></summary>

- ["test/test_debug_md.ml":8:19](../test/test_debug_md.ml#L8)
- ["test/test_debug_md.ml":7:19](../test/test_debug_md.ml#L7)
- `x = 7`
- <details><summary><a id="2"></a> &nbsp; <code>y = 8</code></summary>

- ["test/test_debug_md.ml":9:6](../test/test_debug_md.ml#L9)
- ["test/test_debug_md.ml":8:6](../test/test_debug_md.ml#L8)
</details>

</details>


<details><summary><a id="3"></a> &nbsp; <code>bar = 336</code></summary>

- ["test/test_debug_md.ml":16:19](../test/test_debug_md.ml#L16)
- ["test/test_debug_md.ml":15:19](../test/test_debug_md.ml#L15)
- `x = ((first 7) (second 42))`
- <details><summary><a id="4"></a> &nbsp; <code>y = 8</code></summary>

- ["test/test_debug_md.ml":17:6](../test/test_debug_md.ml#L17)
- ["test/test_debug_md.ml":16:6](../test/test_debug_md.ml#L16)
</details>

</details>


<details><summary><a id="5"></a> &nbsp; <code>baz = 359</code></summary>

- ["test/test_debug_md.ml":22:19](../test/test_debug_md.ml#L22)
- ["test/test_debug_md.ml":21:19](../test/test_debug_md.ml#L21)
- `x = ((first 7) (second 42))`
- <details><summary><a id="6"></a> &nbsp; <code>_yz = (8 3)</code></summary>

- ["test/test_debug_md.ml":23:17](../test/test_debug_md.ml#L23)
- ["test/test_debug_md.ml":22:17](../test/test_debug_md.ml#L22)
</details>

- <details><summary><a id="7"></a> &nbsp; <code>_uw = (7 13)</code></summary>

- ["test/test_debug_md.ml":24:17](../test/test_debug_md.ml#L24)
- ["test/test_debug_md.ml":23:17](../test/test_debug_md.ml#L23)
</details>

</details>


<details><summary><a id="8"></a> &nbsp; <code>lab = (7 8 16)</code></summary>

- ["test/test_debug_md.ml":29:19](../test/test_debug_md.ml#L29)
- ["test/test_debug_md.ml":28:19](../test/test_debug_md.ml#L28)
- `x = 7`
- <details><summary><a id="9"></a> &nbsp; <code>y = 8</code></summary>

- ["test/test_debug_md.ml":30:6](../test/test_debug_md.ml#L30)
- ["test/test_debug_md.ml":29:6](../test/test_debug_md.ml#L29)
</details>

</details>


<details><summary><a id="10"></a> &nbsp; <code>loop = 36</code></summary>

- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 0`
- `x = ((first 7) (second 42))`
- <details><summary><a id="11"></a> &nbsp; <code>y = 24</code></summary>

- ["test/test_debug_md.ml":39:8](../test/test_debug_md.ml#L39)
- ["test/test_debug_md.ml":38:8](../test/test_debug_md.ml#L38)
- <details><summary><a id="12"></a> &nbsp; <code>loop = 24</code></summary>

- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 1`
- `x = ((first 41) (second 9))`
- <details><summary><a id="13"></a> &nbsp; <code>y = 25</code></summary>
- ["test/test_debug_md.ml":39:8](../test/test_debug_md.ml#L39)
- ["test/test_debug_md.ml":38:8](../test/test_debug_md.ml#L38)
- <details><summary><a id="14"></a> &nbsp; <code>loop = 25</code></summary>
- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 2`
- `x = ((first 8) (second 43))`
- <details><summary><a id="15"></a> &nbsp; <code>loop = 25</code></summary>
- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 3`
- `x = ((first 44) (second 4))`
- <details><summary><a id="16"></a> &nbsp; <code>loop = 25</code></summary>
- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 4`
- `x = ((first 5) (second 22))`
- <details><summary><a id="17"></a> &nbsp; <code>loop = 25</code></summary>
- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 5`
- `x = ((first 23) (second 2))`
</details>
Expand All @@ -101,25 +101,25 @@ BEGIN DEBUG SESSION
- <details><summary><a id="18"></a> &nbsp; <code>z = 17</code></summary>
- ["test/test_debug_md.ml":40:8](../test/test_debug_md.ml#L40)
- ["test/test_debug_md.ml":39:8](../test/test_debug_md.ml#L39)
- <details><summary><a id="19"></a> &nbsp; <code>loop = 17</code></summary>
- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 2`
- `x = ((first 10) (second 25))`
- <details><summary><a id="20"></a> &nbsp; <code>loop = 17</code></summary>
- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 3`
- `x = ((first 26) (second 5))`
- <details><summary><a id="21"></a> &nbsp; <code>loop = 17</code></summary>
- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 4`
- `x = ((first 6) (second 13))`
- <details><summary><a id="22"></a> &nbsp; <code>loop = 17</code></summary>
- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 5`
- `x = ((first 14) (second 3))`
</details>
Expand All @@ -138,33 +138,33 @@ BEGIN DEBUG SESSION

- <details><summary><a id="23"></a> &nbsp; <code>z = 29</code></summary>

- ["test/test_debug_md.ml":40:8](../test/test_debug_md.ml#L40)
- ["test/test_debug_md.ml":39:8](../test/test_debug_md.ml#L39)
- <details><summary><a id="24"></a> &nbsp; <code>loop = 29</code></summary>

- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 1`
- `x = ((first 43) (second 24))`
- <details><summary><a id="25"></a> &nbsp; <code>y = 30</code></summary>
- ["test/test_debug_md.ml":39:8](../test/test_debug_md.ml#L39)
- ["test/test_debug_md.ml":38:8](../test/test_debug_md.ml#L38)
- <details><summary><a id="26"></a> &nbsp; <code>loop = 30</code></summary>
- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 2`
- `x = ((first 23) (second 45))`
- <details><summary><a id="27"></a> &nbsp; <code>loop = 30</code></summary>
- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 3`
- `x = ((first 46) (second 11))`
- <details><summary><a id="28"></a> &nbsp; <code>loop = 30</code></summary>
- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 4`
- `x = ((first 12) (second 23))`
- <details><summary><a id="29"></a> &nbsp; <code>loop = 30</code></summary>
- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 5`
- `x = ((first 24) (second 6))`
</details>
Expand All @@ -179,25 +179,25 @@ BEGIN DEBUG SESSION
- <details><summary><a id="30"></a> &nbsp; <code>z = 22</code></summary>
- ["test/test_debug_md.ml":40:8](../test/test_debug_md.ml#L40)
- ["test/test_debug_md.ml":39:8](../test/test_debug_md.ml#L39)
- <details><summary><a id="31"></a> &nbsp; <code>loop = 22</code></summary>
- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 2`
- `x = ((first 25) (second 30))`
- <details><summary><a id="32"></a> &nbsp; <code>loop = 22</code></summary>
- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 3`
- `x = ((first 31) (second 12))`
- <details><summary><a id="33"></a> &nbsp; <code>loop = 22</code></summary>
- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 4`
- `x = ((first 13) (second 15))`
- <details><summary><a id="34"></a> &nbsp; <code>loop = 22</code></summary>
- ["test/test_debug_md.ml":35:24](../test/test_debug_md.ml#L35)
- ["test/test_debug_md.ml":34:24](../test/test_debug_md.ml#L34)
- `depth = 5`
- `x = ((first 16) (second 6))`
</details>
Expand Down
2 changes: 1 addition & 1 deletion test/pp.ml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
let () = Ppxlib.Driver.standalone ()
let () = Ppxlib.Driver.standalone ()
14 changes: 7 additions & 7 deletions test/test_debug_log_level_consistency.expected.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ let foo (x : int) =
(let __entry_id = Debug_runtime.get_entry_id () in
();
(Debug_runtime.open_log ~fname:"test_debug_log_level_consistency.ml"
~start_lnum:7 ~start_colnum:19 ~end_lnum:9 ~end_colnum:17
~start_lnum:6 ~start_colnum:19 ~end_lnum:8 ~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_log_level_consistency.ml" ~start_lnum:8
~start_colnum:6 ~end_lnum:8 ~end_colnum:7 ~message:"y"
~fname:"test_debug_log_level_consistency.ml" ~start_lnum:7
~start_colnum:6 ~end_lnum:7 ~end_colnum:7 ~message:"y"
~entry_id:__entry_id ~log_level:1 `Debug;
(match x + 1 with
| y as __res ->
Expand All @@ -37,12 +37,12 @@ let foo (x : int) =
(([%show : int]) y));
Debug_runtime.close_log
~fname:"test_debug_log_level_consistency.ml"
~start_lnum:8 ~entry_id:__entry_id;
~start_lnum:7 ~entry_id:__entry_id;
__res)
| exception e ->
(Debug_runtime.close_log
~fname:"test_debug_log_level_consistency.ml"
~start_lnum:8 ~entry_id:__entry_id;
~start_lnum:7 ~entry_id:__entry_id;
raise e)) in
[x; y; 2 * y]
with
Expand All @@ -51,10 +51,10 @@ let foo (x : int) =
~entry_id:__entry_id ~log_level:1 ~is_result:true
(([%show : int list]) __res);
Debug_runtime.close_log ~fname:"test_debug_log_level_consistency.ml"
~start_lnum:7 ~entry_id:__entry_id;
~start_lnum:6 ~entry_id:__entry_id;
__res)
| exception e ->
(Debug_runtime.close_log ~fname:"test_debug_log_level_consistency.ml"
~start_lnum:7 ~entry_id:__entry_id;
~start_lnum:6 ~entry_id:__entry_id;
raise e)) : int list)
let () = ignore @@ (List.hd @@ (foo 7))
1 change: 0 additions & 1 deletion test/test_debug_log_level_consistency.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module Debug_runtime =

[%%global_debug_log_level_from_env_var "PPX_MINIDEBUG_TEST_LOG_LEVEL_CONSISTENCY"]


let%debug_show foo (x : int) : int list =
let y : int = x + 1 in
[ x; y; 2 * y ]
Expand Down
3 changes: 1 addition & 2 deletions test/test_debug_md.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ open Sexplib0.Sexp_conv

module Debug_runtime =
(val Minidebug_runtime.debug_file ~hyperlink:"../"
~backend:(`Markdown Minidebug_runtime.default_md_config)
"debugger_sexp_md")
~backend:(`Markdown Minidebug_runtime.default_md_config) "debugger_sexp_md")

let%debug_sexp foo (x : int) : int list =
let y : int = x + 1 in
Expand Down
4 changes: 2 additions & 2 deletions test/test_debug_time_spans.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Debug_runtime =
(val Minidebug_runtime.debug_file ~elapsed_times:Microseconds ~hyperlink:"./"
~backend:(`Markdown Minidebug_runtime.default_md_config)
~truncate_children:4 "debugger_sexp_time_spans")
~backend:(`Markdown Minidebug_runtime.default_md_config) ~truncate_children:4
"debugger_sexp_time_spans")

let sexp_of_int i = Sexplib0.Sexp.Atom (string_of_int i)

Expand Down
Loading

0 comments on commit 5c62e96

Please sign in to comment.