Commits

ZyX_I  committed 57085fa

Renamed invalid-unload-self test to invalid-unload, improved invalid-unload test, fixed [un]loadplugin functions error handling

  • Participants
  • Parent commits 00f7cf7

Comments (0)

Files changed (9)

File plugin/frawor.vim

         let plugdict=s:g.pls[a:plid]
     elseif type(a:plid)==type({})
         if has_key(a:plid, 'id') && type(a:plid.id)==type("") &&
-                    \s:g.pls[a:plid.id] is a:plid
+                    \has_key(s:g.pls, a:plid.id) && s:g.pls[a:plid.id] is a:plid
             let plugdict=a:plid
         else
             call s:F._frawor.throw('invplugdict')
         endif
     elseif type(a:plid)==type({})
         if has_key(a:plid, 'id') && type(a:plid.id)==type("") &&
-                    \s:g.pls[a:plid.id] is a:plid
+                    \has_key(s:g.pls, a:plid.id) && s:g.pls[a:plid.id] is a:plid
             let plugdict=a:plid
         else
             call s:F._frawor.throw('invplugdict')

File test/invalid-unload-self.in

-:let &rtp.=",".escape($TESTDIR, ',\').'/rtp'
-:let g:testfile="plugin/invalid-unload-self.vim"
-:source test.vim

File test/invalid-unload.in

+:let &rtp.=",".escape($TESTDIR, ',\').'/rtp'
+:let i=1
+:while filereadable("rtp/plugin/invalid-unload.".i.".vim") | let g:testfile="plugin/invalid-unload.".i.".vim" | source test.vim | let i+=1 | endwhile

File test/invalid-unload.ok

+Frawor:plugin/frawor:invplugdict
+Frawor:plugin/frawor:invunloadarg
+Frawor:plugin/frawor:notloaded
+Frawor:plugin/frawor:invplugdict

File test/rtp/plugin/invalid-unload-self.vim

-execute frawor#Setup('0.0', {}, 1)
-call FraworUnload({'id': 'plugin/invalid-unload-self'})
-

File test/rtp/plugin/invalid-unload.1.vim

+execute frawor#Setup('0.0', {}, 1)
+call FraworUnload({'id': 'plugin/invalid-unload'})
+

File test/rtp/plugin/invalid-unload.2.vim

+execute frawor#Setup('0.0', {}, 1)
+call FraworUnload(['id', 'plugin/invalid-unload'])
+

File test/rtp/plugin/invalid-unload.3.vim

+execute frawor#Setup('0.0', {}, 1)
+call FraworUnload('plugin/nonexistent-plugin')
+

File test/rtp/plugin/invalid-unload.4.vim

+execute frawor#Setup('0.0', {}, 1)
+call FraworUnload({'id': 'plugin/nonexistent-plugin'})
+