Detect and use CM files for smlnj (#884)

* Detect and use CM files for smlnj

* Split into two checkers

- one for CM projects
- one for single SML files

* Fix some typos

* Fix error caught by writing tests

We want to actually use `glob` to search in paths upwards from us.
(Previously we were just searching in the current directory every time!)

* Fix errors from former test run

* Write tests for GetCmFile and GetExecutableSmlnj

* Typo in 'smlnj/' fixture filenames
This commit is contained in:
Jake Zimmerman
2017-09-03 11:56:14 -07:00
committed by w0rp
parent c7fbcb3c02
commit 63e8946fc8
11 changed files with 205 additions and 49 deletions

View File

@@ -1,6 +1,3 @@
Before:
runtime ale_linters/sml/smlnj.vim
Execute (Testing on EOF error):
AssertEqual [
\ {
@@ -11,7 +8,7 @@ Execute (Testing on EOF error):
\ 'text': 'Error: syntax error found at EOF',
\ },
\],
\ ale_linters#sml#smlnj#Handle(42, [
\ ale#handlers#sml#Handle(42, [
\ "Standard ML of New Jersey v110.78 [built: Thu Jul 23 11:21:58 2015]",
\ "[opening a.sml]",
\ "a.sml:2.16 Error: syntax error found at EOF",
@@ -35,7 +32,7 @@ Execute (Testing if the handler can handle multiple errors on the same line):
\ 'text': 'Error: unbound variable or constructor: wow',
\ },
\],
\ ale_linters#sml#smlnj#Handle(42, [
\ ale#handlers#sml#Handle(42, [
\ "Standard ML of New Jersey v110.78 [built: Thu Jul 23 11:21:58 2015]",
\ "[opening test.sml]",
\ "a.sml:1.6-1.10 Error: can't find function arguments in clause",
@@ -61,7 +58,7 @@ Execute (Testing rarer errors):
\ 'text': "Error: value type in structure doesn't match signature spec",
\ },
\],
\ ale_linters#sml#smlnj#Handle(42, [
\ ale#handlers#sml#Handle(42, [
\ "Standard ML of New Jersey v110.78 [built: Thu Jul 23 11:21:58 2015]",
\ "[opening test.sml]",
\ "a.sml:5.19 Error: syntax error found at ID",
@@ -80,7 +77,7 @@ Execute (Testing a warning):
\ 'text': "Warning: match nonexhaustive",
\ },
\],
\ ale_linters#sml#smlnj#Handle(42, [
\ ale#handlers#sml#Handle(42, [
\ "Standard ML of New Jersey v110.78 [built: Thu Jul 23 11:21:58 2015]",
\ "[opening a.sml]",
\ "a.sml:4.5-4.12 Warning: match nonexhaustive",