summaryrefslogtreecommitdiff
path: root/test/fixers/test_erlfmt_fixer_callback.vader
blob: 132cd6eefe4d4d99f115517f5e7218164d09adfe (plain)
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
Before:
  Save b:ale_elm_format_executable
  Save b:ale_elm_format_options

  let b:ale_elm_format_executable = 'erlfmt'
  let b:ale_elm_format_options = ''

After:
  Restore

Execute(The erlfmt command should handle empty options):
  AssertEqual
  \ {
  \   'command': ale#Escape('erlfmt') . ' %s'
  \ },
  \ ale#fixers#erlfmt#Fix(bufnr(''))

Execute(The erlfmt command should handle custom options):
  let b:ale_erlang_erlfmt_options = '--insert-pragma'

  AssertEqual
  \ {
  \   'command': ale#Escape('erlfmt') . ' --insert-pragma %s'
  \ },
  \ ale#fixers#erlfmt#Fix(bufnr(''))