Commits

ZyX_I committed 1499942

tests: Extended require-feature tests

  • Participants
  • Parent commits fd28b4e

Comments (0)

Files changed (5)

File test/require-feature.ok

 require
 throw
 warn
+Entered s:F.main()
+Registered plugin/twoload-plugin-with-feature-2
+Has run :runtime
+Registered plugin/twoload-plugin-with-feature-3
+Loaded plugin/twoload-plugin-with-feature-3
+Has run FraworLoad
+Registered plugin/twoload-plugin-with-feature-1
+Loaded plugin/twoload-plugin-with-feature-1
+feature-register: plugin/twoload-plugin-with-feature-1
+feature-load: plugin/twoload-plugin-with-feature-1
+feature-depadd: plugin/twoload-plugin-with-feature-1 plugin/twoload-plugin-with-feature-1
+require tpwf1: 1
+Loaded plugin/twoload-plugin-with-feature-2
+feature-register: plugin/twoload-plugin-with-feature-2
+feature-load: plugin/twoload-plugin-with-feature-2
+feature-depadd: plugin/twoload-plugin-with-feature-1 plugin/twoload-plugin-with-feature-2
+feature-depadd: plugin/twoload-plugin-with-feature-2 plugin/twoload-plugin-with-feature-2
+require tpwf2: 1
+feature-register: plugin/twoload-plugin-with-feature-3
+feature-load: plugin/twoload-plugin-with-feature-3
+feature-depadd: plugin/twoload-plugin-with-feature-1 plugin/twoload-plugin-with-feature-3
+feature-depadd: plugin/twoload-plugin-with-feature-2 plugin/twoload-plugin-with-feature-3
+feature-depadd: plugin/twoload-plugin-with-feature-3 plugin/twoload-plugin-with-feature-3
+require tpwf3: 1
 feature-load: plugin/require-feature
-require: 1
+feature-depadd: plugin/twoload-plugin-with-feature-1 plugin/plugin-with-feature
+feature-depadd: plugin/twoload-plugin-with-feature-2 plugin/plugin-with-feature
+feature-depadd: plugin/twoload-plugin-with-feature-3 plugin/plugin-with-feature
+require pwf: 1
 newfeature
 require
 testfeature
 throw
 warn
-require: 0
+require xup: 0
 plugin/frawor:reqfailed

File test/rtp/plugin/require-feature.vim

 execute frawor#Setup('0.0', {'@frawor': '0.1'})
 function s:F.main()
-    call WriteFile('require: '.s:_f.require('@plugin-with-feature', [0, 0], 0))
+    call WriteFile('Entered s:F.main()')
+    runtime plugin/twoload-plugin-with-feature-2.vim
+    call WriteFile('Has run :runtime')
+    call FraworLoad('@twoload-plugin-with-feature-3')
+    call WriteFile('Has run FraworLoad')
+    call WriteFile('require tpwf1: '.s:_f.require('@twoload-plugin-with-feature-1', [0, 0], 0))
+    call WriteFile('require tpwf2: '.s:_f.require('@twoload-plugin-with-feature-2', [0, 0], 0))
+    call WriteFile('require tpwf3: '.s:_f.require('@twoload-plugin-with-feature-3', [0, 0], 0))
+    call WriteFile('require pwf: '.s:_f.require('@plugin-with-feature',             [0, 0], 0))
     call WriteFile(sort(keys(s:_f)))
-    call WriteFile('require: '.s:_f.require('@xxx-unexistent-plugin', [0, 0], 0))
-    call WriteFile('require: '.s:_f.require('@xxx-unexistent-plugin', [0, 0], 1))
+    call WriteFile('require xup: '.s:_f.require('@xxx-unexistent-plugin',           [0, 0], 0))
+    call WriteFile('require xup: '.s:_f.require('@xxx-unexistent-plugin',           [0, 0], 1))
 endfunction
 call WriteFile(sort(keys(s:_f)))
 call s:F.main()

File test/rtp/plugin/twoload-plugin-with-feature-1.vim

+if !exists('s:_pluginloaded')
+    execute frawor#Setup('0.0', {}, 0)
+    call WriteFile('Registered '.s:_frawor.id)
+    finish
+elseif s:_pluginloaded
+    finish
+endif
+call WriteFile('Loaded '.s:_frawor.id)
+let s:testfeature={}
+function s:testfeature.depadd(plugdict, fdict, dplid)
+    call WriteFile('feature-depadd: '.s:_frawor.id.' '.a:dplid)
+endfunction
+function s:testfeature.load(plugdict, fdict)
+    call WriteFile('feature-load: '.s:_frawor.id)
+endfunction
+function s:testfeature.register(plugdict, fdict)
+    call WriteFile('feature-register: '.s:_frawor.id)
+endfunction
+function s:testfeature.unload(plugdict, fdict)
+    call WriteFile('feature-unload: '.s:_frawor.id)
+endfunction
+function s:testfeature.unloadpre(plugdict, fdict)
+    call WriteFile('feature-unloadpre: '.s:_frawor.id)
+endfunction
+call s:_f.newfeature('testfeature'.s:_frawor.id[-1:], s:testfeature)

File test/rtp/plugin/twoload-plugin-with-feature-2.vim

+if !exists('s:_pluginloaded')
+    execute frawor#Setup('0.0', {}, 0)
+    call WriteFile('Registered '.s:_frawor.id)
+    finish
+elseif s:_pluginloaded
+    finish
+endif
+call WriteFile('Loaded '.s:_frawor.id)
+let s:testfeature={}
+function s:testfeature.depadd(plugdict, fdict, dplid)
+    call WriteFile('feature-depadd: '.s:_frawor.id.' '.a:dplid)
+endfunction
+function s:testfeature.load(plugdict, fdict)
+    call WriteFile('feature-load: '.s:_frawor.id)
+endfunction
+function s:testfeature.register(plugdict, fdict)
+    call WriteFile('feature-register: '.s:_frawor.id)
+endfunction
+function s:testfeature.unload(plugdict, fdict)
+    call WriteFile('feature-unload: '.s:_frawor.id)
+endfunction
+function s:testfeature.unloadpre(plugdict, fdict)
+    call WriteFile('feature-unloadpre: '.s:_frawor.id)
+endfunction
+call s:_f.newfeature('testfeature'.s:_frawor.id[-1:], s:testfeature)

File test/rtp/plugin/twoload-plugin-with-feature-3.vim

+if !exists('s:_pluginloaded')
+    execute frawor#Setup('0.0', {}, 0)
+    call WriteFile('Registered '.s:_frawor.id)
+    finish
+elseif s:_pluginloaded
+    finish
+endif
+call WriteFile('Loaded '.s:_frawor.id)
+let s:testfeature={}
+function s:testfeature.depadd(plugdict, fdict, dplid)
+    call WriteFile('feature-depadd: '.s:_frawor.id.' '.a:dplid)
+endfunction
+function s:testfeature.load(plugdict, fdict)
+    call WriteFile('feature-load: '.s:_frawor.id)
+endfunction
+function s:testfeature.register(plugdict, fdict)
+    call WriteFile('feature-register: '.s:_frawor.id)
+endfunction
+function s:testfeature.unload(plugdict, fdict)
+    call WriteFile('feature-unload: '.s:_frawor.id)
+endfunction
+function s:testfeature.unloadpre(plugdict, fdict)
+    call WriteFile('feature-unloadpre: '.s:_frawor.id)
+endfunction
+call s:_f.newfeature('testfeature'.s:_frawor.id[-1:], s:testfeature)