]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/handler/test_sml_handler.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '294584081929424aec883f90c7d6515b3743358d' as '.vim/bundle/vim-lsp-ale'
[etc/vim.git] / .vim / bundle / ale / test / handler / test_sml_handler.vader
1 Execute (Testing on EOF error):
2   AssertEqual [
3   \ {
4   \   'filename': 'a.sml',
5   \   'lnum': 2,
6   \   'col': 15,
7   \   'type': 'E',
8   \   'text': 'Error: syntax error found at EOF',
9   \ },
10   \],
11   \ ale#handlers#sml#Handle(42, [
12   \ "Standard ML of New Jersey v110.78 [built: Thu Jul 23 11:21:58 2015]",
13   \ "[opening a.sml]",
14   \ "a.sml:2.16 Error: syntax error found at EOF",
15   \ '/usr/lib/smlnj/bin/sml: Fatal error -- Uncaught exception Compile with "syntax error" raised at ../compiler/Parse/main/smlfile.sml:15.24-15.46',
16   \])
17
18 Execute (Testing if the handler can handle multiple errors on the same line):
19   AssertEqual [
20   \ {
21   \   'filename': 'a.sml',
22   \   'lnum': 1,
23   \   'col': 5,
24   \   'type': 'E',
25   \   'text': "Error: can't find function arguments in clause",
26   \ },
27   \ {
28   \   'filename': 'a.sml',
29   \   'lnum': 1,
30   \   'col': 12,
31   \   'type': 'E',
32   \   'text': 'Error: unbound variable or constructor: wow',
33   \ },
34   \],
35   \ ale#handlers#sml#Handle(42, [
36   \ "Standard ML of New Jersey v110.78 [built: Thu Jul 23 11:21:58 2015]",
37   \ "[opening test.sml]",
38   \ "a.sml:1.6-1.10 Error: can't find function arguments in clause",
39   \ "a.sml:1.13-1.16 Error: unbound variable or constructor: wow",
40   \ "/usr/lib/smlnj/bin/sml: Fatal error -- Uncaught exception Error with 0",
41   \ "raised at ../compiler/TopLevel/interact/evalloop.sml:66.19-66.27",
42   \])
43
44 Execute (Testing rarer errors):
45   AssertEqual [
46   \ {
47   \   'filename': 'a.sml',
48   \   'lnum': 5,
49   \   'col': 18,
50   \   'type': 'E',
51   \   'text': "Error: syntax error found at ID",
52   \ },
53   \ {
54   \   'filename': 'a.sml',
55   \   'lnum': 7,
56   \   'col': 0,
57   \   'type': 'E',
58   \   'text': "Error: value type in structure doesn't match signature spec",
59   \ },
60   \],
61   \ ale#handlers#sml#Handle(42, [
62   \ "Standard ML of New Jersey v110.78 [built: Thu Jul 23 11:21:58 2015]",
63   \ "[opening test.sml]",
64   \ "a.sml:5.19 Error: syntax error found at ID",
65   \ "a.sml:7.1-9.27 Error: value type in structure doesn't match signature spec",
66   \ "/usr/lib/smlnj/bin/sml: Fatal error -- Uncaught exception Error with 0",
67   \ "raised at ../compiler/TopLevel/interact/evalloop.sml:66.19-66.27",
68   \])
69
70 Execute (Testing a warning):
71   AssertEqual [
72   \ {
73   \   'filename': 'a.sml',
74   \   'lnum': 4,
75   \   'col': 4,
76   \   'type': 'W',
77   \   'text': "Warning: match nonexhaustive",
78   \ },
79   \],
80   \ ale#handlers#sml#Handle(42, [
81   \ "Standard ML of New Jersey v110.78 [built: Thu Jul 23 11:21:58 2015]",
82   \ "[opening a.sml]",
83   \ "a.sml:4.5-4.12 Warning: match nonexhaustive",
84             \ "0 => ...",
85   \ "val f = fn : int -> int",
86   \ "-",
87   \])
88
89 Execute (Testing stdIn):
90   AssertEqual [
91   \ {
92   \   'bufnr': 42,
93   \   'lnum': 1,
94   \   'col': 5,
95   \   'type': 'E',
96   \   'text': "Error: operator and operand don't agree [overload conflict]",
97   \ },
98   \ {
99   \   'bufnr': 42,
100   \   'lnum': 2,
101   \   'col': 4,
102   \   'type': 'E',
103   \   'text': "Error: operator and operand don't agree [overload conflict]",
104   \ },
105   \],
106   \ ale#handlers#sml#Handle(42, [
107   \ "Standard ML of New Jersey v110.79 [built: Sat Oct 26 12:27:04 2019]",
108   \ "- = stdIn:1.6-1.21 Error: operator and operand don't agree [overload conflict]",
109   \ "  operator domain: [+ ty] * [+ ty]",
110   \ "  operand:         string * [int ty]",
111   \ "  in expression:",
112   \ '    "abc" + 123',
113   \ "stdIn:2.5-2.20 Error: operator and operand don't agree [overload conflict]",
114   \ "  operator domain: [+ ty] * [+ ty]",
115   \ "  operand:         [+ ty] * string",
116   \ "  in expression:",
117   \ '    890 + "xyz"',
118   \ "-",
119   \])