package forester

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file Testables.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
(*
 * SPDX-FileCopyrightText: 2024 The Forester Project Contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 *)

open Forester_core
open Forester_compiler
open Alcotest

type 'a bwd = 'a Bwd.bwd =
  | Emp
  | Snoc of 'a bwd * 'a
[@@deriving show]

type backtrace = Asai.Diagnostic.backtrace Bwd.bwd
[@printer pp_bwd]

type severity = Asai.Diagnostic.severity =
  | Hint
  | Info
  | Warning
  | Error
  | Bug
[@@deriving show]

let pp_loctext = fun fmt text -> Format.pp_print_string fmt (Asai.Diagnostic.string_of_text Asai.Range.(text.value))

type 'a diagnostic =
  'a Asai.Diagnostic.t = {
  severity: Asai.Diagnostic.severity; [@printer pp_severity]
  message: 'a;
  explanation: Asai.Diagnostic.loctext; [@printer pp_loctext]
  backtrace: Asai.Diagnostic.backtrace; [@printer pp_bwd pp_loctext]
  extra_remarks: Asai.Diagnostic.loctext Bwd.bwd; [@printer pp_bwd pp_loctext]
}
[@@deriving show]

let message = testable Reporter.Message.pp (=)

let delim = testable Forester_core.pp_delim (=)
let code = testable Forester_core.Code.pp (=)
let code_node = testable Forester_core.Code.pp_node (=)
let syn_node = testable Forester_core.Syn.pp_node (=)
let syn = testable Syn.pp (=)
let eval_result = testable Eval.pp_result (=)
let path = testable Trie.pp_path (=)
let data = testable Syn.pp_resolver_data (=)
let diagnostic =
  let pp = pp_diagnostic Reporter.Message.pp in
  testable pp (=)

let uri = testable URI.pp URI.equal

let config = Alcotest.testable Config.pp (=)

let document =
  let pp fmt t = Format.pp_print_string fmt (Lsp.Text_document.text t) in
  testable pp (=)

let tree = testable Code.pp_tree (=)

let result = testable Eval.pp_result (=)
let content = testable Types.pp_content (=)

let action = testable Action.pp (=)

let completion_type = testable Forester_lsp.Completion.pp_completion (=)
OCaml

Innovation. Community. Security.