2017-09-03 18:56:14 +00:00
|
|
|
Before:
|
|
|
|
call ale#test#SetDirectory('/testplugin/test')
|
|
|
|
|
|
|
|
After:
|
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
call ale#linter#Reset()
|
|
|
|
|
|
|
|
Execute(smlnj finds CM file if it exists):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/smlnj/cm/foo.sml')
|
2017-09-03 18:56:14 +00:00
|
|
|
|
2017-09-09 23:20:05 +00:00
|
|
|
AssertEqual
|
2021-03-20 22:11:22 +00:00
|
|
|
\ ale#test#GetFilename('test-files/smlnj/cm/sources.cm'),
|
2017-09-09 23:20:05 +00:00
|
|
|
\ ale#handlers#sml#GetCmFile(bufnr('%'))
|
2017-09-03 18:56:14 +00:00
|
|
|
|
|
|
|
Execute(smlnj finds CM file by searching upwards):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/smlnj/cm/path/to/bar.sml')
|
2017-09-03 18:56:14 +00:00
|
|
|
|
2017-09-09 23:20:05 +00:00
|
|
|
AssertEqual
|
2021-03-20 22:11:22 +00:00
|
|
|
\ ale#test#GetFilename('test-files/smlnj/cm/sources.cm'),
|
2017-09-09 23:20:05 +00:00
|
|
|
\ ale#handlers#sml#GetCmFile(bufnr('%'))
|
2017-09-03 18:56:14 +00:00
|
|
|
|
|
|
|
Execute(smlnj returns '' when no CM file found):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/smlnj/file/qux.sml')
|
2017-09-03 18:56:14 +00:00
|
|
|
|
|
|
|
AssertEqual '', ale#handlers#sml#GetCmFile(bufnr('%'))
|
|
|
|
|
|
|
|
Execute(CM-project mode enabled when CM file found):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/smlnj/cm/foo.sml')
|
2017-09-03 18:56:14 +00:00
|
|
|
|
|
|
|
AssertEqual 'sml', ale#handlers#sml#GetExecutableSmlnjCm(bufnr('%'))
|
|
|
|
|
|
|
|
Execute(single-file mode disabled when CM file found):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/smlnj/cm/foo.sml')
|
2017-09-03 18:56:14 +00:00
|
|
|
|
|
|
|
AssertEqual '', ale#handlers#sml#GetExecutableSmlnjFile(bufnr('%'))
|
|
|
|
|
|
|
|
Execute(CM-project mode disabled when CM file not found):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/smlnj/file/qux.sml')
|
2017-09-03 18:56:14 +00:00
|
|
|
|
|
|
|
AssertEqual '', ale#handlers#sml#GetExecutableSmlnjCm(bufnr('%'))
|
|
|
|
|
|
|
|
Execute(single-file mode enabled when CM file found):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/smlnj/file/qux.sml')
|
2017-09-03 18:56:14 +00:00
|
|
|
|
|
|
|
AssertEqual 'sml', ale#handlers#sml#GetExecutableSmlnjFile(bufnr('%'))
|