comparison src/testdir/test_filetype.vim @ 27070:b353bd9faec8 v8.2.4064

patch 8.2.4064: foam files are not detected Commit: https://github.com/vim/vim/commit/2284f6cca384e0ccc352bfec7277dc26386cac3d Author: Elwardi <elwardifadeli@gmail.com> Date: Tue Jan 11 18:14:23 2022 +0000 patch 8.2.4064: foam files are not detected Problem: Foam files are not detected. Solution: Detect the foam filetype by the path and file contents. (Mohammed Elwardi Fadeli, closes #9501)
author Bram Moolenaar <Bram@vim.org>
date Tue, 11 Jan 2022 19:15:04 +0100
parents 499b9122b9ff
children d539c144aeb4
comparison
equal deleted inserted replaced
27069:940d27b64e91 27070:b353bd9faec8
1119 1119
1120 call delete('Xrepo.git', 'rf') 1120 call delete('Xrepo.git', 'rf')
1121 filetype off 1121 filetype off
1122 endfunc 1122 endfunc
1123 1123
1124 func Test_foam_file()
1125 filetype on
1126 call assert_true(mkdir('0', 'p'))
1127 call assert_true(mkdir('0.orig', 'p'))
1128
1129 call writefile(['FoamFile {', ' object something;'], 'Xfile1Dict')
1130 split Xfile1Dict
1131 call assert_equal('foam', &filetype)
1132 bwipe!
1133
1134 call writefile(['FoamFile {', ' object something;'], 'Xfile1Dict.something')
1135 split Xfile1Dict.something
1136 call assert_equal('foam', &filetype)
1137 bwipe!
1138
1139 call writefile(['FoamFile {', ' object something;'], 'XfileProperties')
1140 split XfileProperties
1141 call assert_equal('foam', &filetype)
1142 bwipe!
1143
1144 call writefile(['FoamFile {', ' object something;'], 'XfileProperties.something')
1145 split XfileProperties.something
1146 call assert_equal('foam', &filetype)
1147 bwipe!
1148
1149 call writefile(['FoamFile {', ' object something;'], 'XfileProperties')
1150 split XfileProperties
1151 call assert_equal('foam', &filetype)
1152 bwipe!
1153
1154 call writefile(['FoamFile {', ' object something;'], 'XfileProperties.something')
1155 split XfileProperties.something
1156 call assert_equal('foam', &filetype)
1157 bwipe!
1158
1159 call writefile(['FoamFile {', ' object something;'], '0/Xfile')
1160 split 0/Xfile
1161 call assert_equal('foam', &filetype)
1162 bwipe!
1163
1164 call writefile(['FoamFile {', ' object something;'], '0.orig/Xfile')
1165 split 0.orig/Xfile
1166 call assert_equal('foam', &filetype)
1167 bwipe!
1168
1169 call delete('0', 'rf')
1170 call delete('0.orig', 'rf')
1171 filetype off
1172 endfunc
1173
1124 " vim: shiftwidth=2 sts=2 expandtab 1174 " vim: shiftwidth=2 sts=2 expandtab