blob: d010c3b8f147cf7dc14b1ebb86b2978efe6519a5 [file] [log] [blame]
Bram Moolenaar5b5adf52017-09-09 18:16:43 +02001" This test is in a separate file, because it usually causes reports for memory
2" leaks under valgrind. That is because when fork/exec fails memory is not
3" freed. Since the process exists right away it's not a real leak.
4
5if !has('terminal')
Bram Moolenaarb0f94c12019-06-13 22:19:53 +02006 throw 'Skipped, terminal feature missing'
Bram Moolenaar5b5adf52017-09-09 18:16:43 +02007endif
8
9source shared.vim
10
11func Test_terminal_redir_fails()
12 if has('unix')
13 let buf = term_start('xyzabc', {'err_io': 'file', 'err_name': 'Xfile'})
14 call term_wait(buf)
15 call WaitFor('len(readfile("Xfile")) > 0')
16 call assert_match('executing job failed', readfile('Xfile')[0])
17 call WaitFor('!&modified')
18 call delete('Xfile')
19 bwipe
20 endif
21endfunc