annotate src/testdir/test_compiler.vim @ 18124:2a806e3c39f6 v8.1.2057

patch 8.1.2057: the screen.c file is much too big Commit: https://github.com/vim/vim/commit/7528d1f6b5422750eb778dfb550cfd0b0e540964 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 19 23:06:20 2019 +0200 patch 8.1.2057: the screen.c file is much too big Problem: The screen.c file is much too big. Solution: Split it in three parts. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/4943)
author Bram Moolenaar <Bram@vim.org>
date Thu, 19 Sep 2019 23:15:05 +0200
parents 9b7c7754ba9d
children 57b18521216f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13970
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test the :compiler command
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 func Test_compiler()
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 if !executable('perl')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 return
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 endif
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7
14260
9ff35e144467 patch 8.1.0146: when $LANG is set the compiler test may fail
Christian Brabandt <cb@256bit.org>
parents: 13974
diff changeset
8 " $LANG changes the output of Perl.
9ff35e144467 patch 8.1.0146: when $LANG is set the compiler test may fail
Christian Brabandt <cb@256bit.org>
parents: 13974
diff changeset
9 if $LANG != ''
9ff35e144467 patch 8.1.0146: when $LANG is set the compiler test may fail
Christian Brabandt <cb@256bit.org>
parents: 13974
diff changeset
10 unlet $LANG
9ff35e144467 patch 8.1.0146: when $LANG is set the compiler test may fail
Christian Brabandt <cb@256bit.org>
parents: 13974
diff changeset
11 endif
9ff35e144467 patch 8.1.0146: when $LANG is set the compiler test may fail
Christian Brabandt <cb@256bit.org>
parents: 13974
diff changeset
12
17572
0d7c87cad133 patch 8.1.1783: MS-Windows: compiler test may fail when using %:S
Bram Moolenaar <Bram@vim.org>
parents: 14260
diff changeset
13 " %:S does not work properly with 'shellslash' set
0d7c87cad133 patch 8.1.1783: MS-Windows: compiler test may fail when using %:S
Bram Moolenaar <Bram@vim.org>
parents: 14260
diff changeset
14 let save_shellslash = &shellslash
0d7c87cad133 patch 8.1.1783: MS-Windows: compiler test may fail when using %:S
Bram Moolenaar <Bram@vim.org>
parents: 14260
diff changeset
15 set noshellslash
0d7c87cad133 patch 8.1.1783: MS-Windows: compiler test may fail when using %:S
Bram Moolenaar <Bram@vim.org>
parents: 14260
diff changeset
16
13970
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 e Xfoo.pl
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 compiler perl
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 call assert_equal('perl', b:current_compiler)
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 call assert_fails('let g:current_compiler', 'E121:')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 call setline(1, ['#!/usr/bin/perl -w', 'use strict;', 'my $foo=1'])
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 w!
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 call feedkeys(":make\<CR>\<CR>", 'tx')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 call assert_fails('clist', 'E42:')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 call setline(1, ['#!/usr/bin/perl -w', 'use strict;', '$foo=1'])
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 w!
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 call feedkeys(":make\<CR>\<CR>", 'tx')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 let a=execute('clist')
18118
9b7c7754ba9d patch 8.1.2054: compiler test for Perl may fail
Bram Moolenaar <Bram@vim.org>
parents: 17572
diff changeset
31 call assert_match('\n \d\+ Xfoo.pl:3: Global symbol "$foo" '
9b7c7754ba9d patch 8.1.2054: compiler test for Perl may fail
Bram Moolenaar <Bram@vim.org>
parents: 17572
diff changeset
32 \ . 'requires explicit package name', a)
9b7c7754ba9d patch 8.1.2054: compiler test for Perl may fail
Bram Moolenaar <Bram@vim.org>
parents: 17572
diff changeset
33
13970
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34
17572
0d7c87cad133 patch 8.1.1783: MS-Windows: compiler test may fail when using %:S
Bram Moolenaar <Bram@vim.org>
parents: 14260
diff changeset
35 let &shellslash = save_shellslash
13970
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 call delete('Xfoo.pl')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 bw!
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 endfunc
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 func Test_compiler_without_arg()
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 let a=split(execute('compiler'))
13974
13cdf007cd2c patch 8.1.0005: test for :compiler command fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 13972
diff changeset
42 call assert_match('^.*runtime/compiler/ant.vim$', a[0])
13cdf007cd2c patch 8.1.0005: test for :compiler command fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 13972
diff changeset
43 call assert_match('^.*runtime/compiler/bcc.vim$', a[1])
13cdf007cd2c patch 8.1.0005: test for :compiler command fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 13972
diff changeset
44 call assert_match('^.*runtime/compiler/xmlwf.vim$', a[-1])
13970
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 endfunc
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 func Test_compiler_completion()
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 call feedkeys(":compiler \<C-A>\<C-B>\"\<CR>", 'tx')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 call assert_match('^"compiler ant bcc .* xmlwf$', @:)
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 call feedkeys(":compiler p\<C-A>\<C-B>\"\<CR>", 'tx')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 call assert_equal('"compiler pbx perl php pylint pyunit', @:)
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 call feedkeys(":compiler! p\<C-A>\<C-B>\"\<CR>", 'tx')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 call assert_equal('"compiler! pbx perl php pylint pyunit', @:)
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 endfunc
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 func Test_compiler_error()
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 call assert_fails('compiler doesnotexist', 'E666:')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 endfunc