File: test_tmpdir_wrapper.vader

package info (click to toggle)
vim-ale 4.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,764 kB
  • sloc: sh: 499; python: 311; perl: 31; makefile: 4; xml: 4; javascript: 1
file content (32 lines) | stat: -rw-r--r-- 793 bytes parent folder | download
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
26
27
28
29
30
31
32
Before:
  let g:exists = exists('$TMPDIR')
  let g:old_value = $TMPDIR

After:
  if g:exists
    let $TMPDIR = g:old_value
  else
    silent! unlet! $TMPDIR
  endif

  unlet! g:exists
  unlet! g:old_value

Execute(ale#util#Tempname shouldn't set $TMPDIR to an empty string if it isn't set):
  " You can't run this test twice on old Vim versions.
  if has('unix')
    Assert ale#util#Tempname() =~# '^/tmp'
    Assert !exists('$TMPDIR'), '$TMPDIR exists where it shouldn''t'
  endif

Execute(ale#util#Tempname shouldn't replace $TMPDIR and reset them to an empty string):
  if has('unix')
    let $TMPDIR = ''
    Assert ale#util#Tempname() =~# '^/tmp'

    if !has('nvim')
      Assert exists('$TMPDIR'), '$TMPDIR doesn''t exist where it should'
    endif

    AssertEqual '', $TMPDIR
  endif