Mercurial > vim
comparison src/testdir/test_quickfix.vim @ 17172:6990c1160ea5 v8.1.1585
patch 8.1.1585: :let-heredoc does not trim enough
commit https://github.com/vim/vim/commit/e7eb92708ec2092a2fc11e78703b5dcf83844412
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jun 24 00:58:07 2019 +0200
patch 8.1.1585: :let-heredoc does not trim enough
Problem: :let-heredoc does not trim enough.
Solution: Trim indent from the contents based on the indent of the first
line. Use let-heredoc in more tests.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 24 Jun 2019 01:00:05 +0200 |
parents | 8e9e9124c7a2 |
children | 9606c0adc148 |
comparison
equal
deleted
inserted
replaced
17171:1b0f624dcd8d | 17172:6990c1160ea5 |
---|---|
816 " This test works only on Unix-like systems. | 816 " This test works only on Unix-like systems. |
817 return | 817 return |
818 endif | 818 endif |
819 | 819 |
820 let l =<< trim [DATA] | 820 let l =<< trim [DATA] |
821 "Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set. | 821 "Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set. |
822 "Xtestfile", line 6 col 19; this is an error | 822 "Xtestfile", line 6 col 19; this is an error |
823 gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include version.c | 823 gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include version.c |
824 Xtestfile:9: parse error before `asd' | 824 Xtestfile:9: parse error before `asd' |
825 make: *** [vim] Error 1 | 825 make: *** [vim] Error 1 |
826 in file "Xtestfile" linenr 10: there is an error | 826 in file "Xtestfile" linenr 10: there is an error |
827 | 827 |
828 2 returned | 828 2 returned |
829 "Xtestfile", line 11 col 1; this is an error | 829 "Xtestfile", line 11 col 1; this is an error |
830 "Xtestfile", line 12 col 2; this is another error | 830 "Xtestfile", line 12 col 2; this is another error |
831 "Xtestfile", line 14:10; this is an error in column 10 | 831 "Xtestfile", line 14:10; this is an error in column 10 |
832 =Xtestfile=, line 15:10; this is another error, but in vcol 10 this time | 832 =Xtestfile=, line 15:10; this is another error, but in vcol 10 this time |
833 "Xtestfile", linenr 16: yet another problem | 833 "Xtestfile", linenr 16: yet another problem |
834 Error in "Xtestfile" at line 17: | 834 Error in "Xtestfile" at line 17: |
835 x should be a dot | 835 x should be a dot |
836 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17 | 836 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17 |
837 ^ | 837 ^ |
838 Error in "Xtestfile" at line 18: | 838 Error in "Xtestfile" at line 18: |
839 x should be a dot | 839 x should be a dot |
840 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18 | 840 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18 |
841 .............^ | 841 .............^ |
842 Error in "Xtestfile" at line 19: | 842 Error in "Xtestfile" at line 19: |
843 x should be a dot | 843 x should be a dot |
844 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19 | 844 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19 |
845 --------------^ | 845 --------------^ |
846 Error in "Xtestfile" at line 20: | 846 Error in "Xtestfile" at line 20: |
847 x should be a dot | 847 x should be a dot |
848 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20 | 848 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20 |
849 ^ | 849 ^ |
850 | 850 |
851 Does anyone know what is the problem and how to correction it? | 851 Does anyone know what is the problem and how to correction it? |
852 "Xtestfile", line 21 col 9: What is the title of the quickfix window? | 852 "Xtestfile", line 21 col 9: What is the title of the quickfix window? |
853 "Xtestfile", line 22 col 9: What is the title of the quickfix window? | 853 "Xtestfile", line 22 col 9: What is the title of the quickfix window? |
854 [DATA] | 854 [DATA] |
855 | 855 |
856 call writefile(l, 'Xerrorfile1') | 856 call writefile(l, 'Xerrorfile1') |
857 call writefile(l[:-2], 'Xerrorfile2') | 857 call writefile(l[:-2], 'Xerrorfile2') |
858 | 858 |
859 let m =<< trim [DATA] | 859 let m =<< [DATA] |
860 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 2 | 860 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 2 |
861 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 3 | 861 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 3 |
862 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 4 | 862 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 4 |
863 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 5 | 863 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 5 |
864 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 6 | 864 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 6 |
865 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 7 | 865 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 7 |
866 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 8 | 866 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 8 |
867 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 9 | 867 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 9 |
868 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 10 | 868 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 10 |
869 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 11 | 869 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 11 |
870 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 12 | 870 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 12 |
871 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 13 | 871 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 13 |
872 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 14 | 872 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 14 |
873 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 15 | 873 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 15 |
874 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 16 | 874 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 16 |
875 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17 | 875 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17 |
876 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18 | 876 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18 |
877 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19 | 877 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19 |
878 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20 | 878 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20 |
879 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 21 | 879 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 21 |
880 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 22 | 880 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 22 |
881 [DATA] | 881 [DATA] |
882 call writefile(m, 'Xtestfile') | 882 call writefile(m, 'Xtestfile') |
883 | 883 |
884 let save_efm = &efm | 884 let save_efm = &efm |
885 set efm+==%f=\\,\ line\ %l%*\\D%v%*[^\ ]\ %m | 885 set efm+==%f=\\,\ line\ %l%*\\D%v%*[^\ ]\ %m |
886 set efm^=%AError\ in\ \"%f\"\ at\ line\ %l:,%Z%p^,%C%m | 886 set efm^=%AError\ in\ \"%f\"\ at\ line\ %l:,%Z%p^,%C%m |
1090 let l = split(execute('clist', ''), "\n") | 1090 let l = split(execute('clist', ''), "\n") |
1091 call assert_equal([' 1 Xtestfile:^\VLine search text\$: '], l) | 1091 call assert_equal([' 1 Xtestfile:^\VLine search text\$: '], l) |
1092 | 1092 |
1093 " Test for %P, %Q and %t format specifiers | 1093 " Test for %P, %Q and %t format specifiers |
1094 let lines =<< trim [DATA] | 1094 let lines =<< trim [DATA] |
1095 [Xtestfile1] | 1095 [Xtestfile1] |
1096 (1,17) error: ';' missing | 1096 (1,17) error: ';' missing |
1097 (21,2) warning: variable 'z' not defined | 1097 (21,2) warning: variable 'z' not defined |
1098 (67,3) error: end of file found before string ended | 1098 (67,3) error: end of file found before string ended |
1099 -- | 1099 -- |
1100 | 1100 |
1101 [Xtestfile2] | 1101 [Xtestfile2] |
1102 -- | 1102 -- |
1103 | 1103 |
1104 [Xtestfile3] | 1104 [Xtestfile3] |
1105 NEW compiler v1.1 | 1105 NEW compiler v1.1 |
1106 (2,2) warning: variable 'x' not defined | 1106 (2,2) warning: variable 'x' not defined |
1107 (67,3) warning: 's' already defined | 1107 (67,3) warning: 's' already defined |
1108 -- | 1108 -- |
1109 [DATA] | 1109 [DATA] |
1110 | 1110 |
1111 set efm=%+P[%f]%r,(%l\\,%c)%*[\ ]%t%*[^:]:\ %m,%+Q--%r | 1111 set efm=%+P[%f]%r,(%l\\,%c)%*[\ ]%t%*[^:]:\ %m,%+Q--%r |
1112 " To exercise the push/pop file functionality in quickfix, the test files | 1112 " To exercise the push/pop file functionality in quickfix, the test files |
1113 " need to be created. | 1113 " need to be created. |
1128 call delete('Xtestfile2') | 1128 call delete('Xtestfile2') |
1129 call delete('Xtestfile3') | 1129 call delete('Xtestfile3') |
1130 | 1130 |
1131 " Tests for %E, %C and %Z format specifiers | 1131 " Tests for %E, %C and %Z format specifiers |
1132 let lines =<< trim [DATA] | 1132 let lines =<< trim [DATA] |
1133 Error 275 | 1133 Error 275 |
1134 line 42 | 1134 line 42 |
1135 column 3 | 1135 column 3 |
1136 ' ' expected after '--' | 1136 ' ' expected after '--' |
1137 [DATA] | 1137 [DATA] |
1138 | 1138 |
1139 set efm=%EError\ %n,%Cline\ %l,%Ccolumn\ %c,%Z%m | 1139 set efm=%EError\ %n,%Cline\ %l,%Ccolumn\ %c,%Z%m |
1140 cgetexpr lines | 1140 cgetexpr lines |
1141 let l = getqflist() | 1141 let l = getqflist() |
1145 call assert_equal('E', l[0].type) | 1145 call assert_equal('E', l[0].type) |
1146 call assert_equal("\n' ' expected after '--'", l[0].text) | 1146 call assert_equal("\n' ' expected after '--'", l[0].text) |
1147 | 1147 |
1148 " Test for %> | 1148 " Test for %> |
1149 let lines =<< trim [DATA] | 1149 let lines =<< trim [DATA] |
1150 Error in line 147 of foo.c: | 1150 Error in line 147 of foo.c: |
1151 unknown variable 'i' | 1151 unknown variable 'i' |
1152 [DATA] | 1152 [DATA] |
1153 | 1153 |
1154 set efm=unknown\ variable\ %m,%E%>Error\ in\ line\ %l\ of\ %f:,%Z%m | 1154 set efm=unknown\ variable\ %m,%E%>Error\ in\ line\ %l\ of\ %f:,%Z%m |
1155 cgetexpr lines | 1155 cgetexpr lines |
1156 let l = getqflist() | 1156 let l = getqflist() |
1158 call assert_equal('E', l[0].type) | 1158 call assert_equal('E', l[0].type) |
1159 call assert_equal("\nunknown variable 'i'", l[0].text) | 1159 call assert_equal("\nunknown variable 'i'", l[0].text) |
1160 | 1160 |
1161 " Test for %A, %C and other formats | 1161 " Test for %A, %C and other formats |
1162 let lines =<< trim [DATA] | 1162 let lines =<< trim [DATA] |
1163 ============================================================== | 1163 ============================================================== |
1164 FAIL: testGetTypeIdCachesResult (dbfacadeTest.DjsDBFacadeTest) | 1164 FAIL: testGetTypeIdCachesResult (dbfacadeTest.DjsDBFacadeTest) |
1165 -------------------------------------------------------------- | 1165 -------------------------------------------------------------- |
1166 Traceback (most recent call last): | 1166 Traceback (most recent call last): |
1167 File "unittests/dbfacadeTest.py", line 89, in testFoo | 1167 File "unittests/dbfacadeTest.py", line 89, in testFoo |
1168 self.assertEquals(34, dtid) | 1168 self.assertEquals(34, dtid) |
1169 File "/usr/lib/python2.2/unittest.py", line 286, in | 1169 File "/usr/lib/python2.2/unittest.py", line 286, in |
1170 failUnlessEqual | 1170 failUnlessEqual |
1171 raise self.failureException, \\ | 1171 raise self.failureException, \\ |
1172 AssertionError: 34 != 33 | 1172 AssertionError: 34 != 33 |
1173 | 1173 |
1174 -------------------------------------------------------------- | 1174 -------------------------------------------------------------- |
1175 Ran 27 tests in 0.063s | 1175 Ran 27 tests in 0.063s |
1176 [DATA] | 1176 [DATA] |
1177 | 1177 |
1178 set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m | 1178 set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m |
1179 cgetexpr lines | 1179 cgetexpr lines |
1180 let l = getqflist() | 1180 let l = getqflist() |