Files
ale/test/fixers/test_rescript_fixer_callback.vader
John Jackson 0360a73644 Add ReScript support (#5072)
This adds support for both rescript format and rescript-language-server.

Closes https://github.com/dense-analysis/ale/issues/3335
2025-12-21 18:25:42 +09:00

47 lines
1.3 KiB
Plaintext

Before:
call ale#assert#SetUpFixerTest('rescript', 'rescript_format')
After:
call ale#assert#TearDownFixerTest()
Execute(The rescript callback should return the correct default values):
call ale#test#SetFilename('../test-files/rescript/testfile-noextension')
set filetype=rescript
GivenCommandOutput ['12.0.0']
AssertFixer
\ {
\ 'command':
\ ale#Escape(g:ale_rescript_format_executable) . ' format --stdin .res'
\ }
Execute(The rescript callback should correctly detect res files):
call ale#test#SetFilename('../test-files/rescript/testfile.res')
GivenCommandOutput ['12.0.0']
AssertFixer
\ {
\ 'command':
\ ale#Escape(g:ale_rescript_format_executable) . ' format --stdin .res'
\ }
Execute(The rescript callback should correctly detect resi files):
call ale#test#SetFilename('../test-files/rescript/testfile.resi')
GivenCommandOutput ['12.0.0']
AssertFixer
\ {
\ 'command':
\ ale#Escape(g:ale_rescript_format_executable) . ' format --stdin .resi'
\ }
Execute(The version check should be correct):
call ale#test#SetFilename('../test-files/rescript/testfile.res')
GivenCommandOutput ['11.0.0']
AssertFixer
\ {
\ 'command':
\ ale#Escape(g:ale_rescript_format_executable) . ' format -stdin .res'
\ }