File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed
_testdata/vital/datatest/autoload/vital/__latest__ Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 1+ let s: datafile = expand (' <sfile>:h' ) . ' /DataTest.txt'
2+
13function ! s: _vital_loaded (V) abort
24 let s: V = a: V
35endfunction
46
57function ! s: _vital_depends () abort
6- return {' modules' :[], ' files' :[' DataTest.txt' ]}
8+ return {
9+ \ ' modules' :[],
10+ \ ' files' : [' DataTest.txt' ],
11+ \}
712endfunction
813
9- function ! s: dummy () abort
10- return 0
14+ function ! s: exists () abort
15+ return filereadable ( s: datafile )
1116endfunction
1217
18+ function ! s: valid () abort
19+ let data = readfile (s: datafile )
20+ return (1 == ? len (data)) &&
21+ \ (' Test Data' == ? data[0 ])
22+ endfunction
Original file line number Diff line number Diff line change @@ -240,7 +240,9 @@ Describe vital
240240 End
241241
242242 It supports datafile dependencies
243- Assert True(1 == len(readfile(Filepath.join(g:testplugin_root, 'autoload/vital/' . '_' . g:testplugin_name . '/DataTest.txt'))))
243+ Assert True(filereadable(Filepath.join(g:testplugin_root, 'autoload/vital/' . '_' . g:testplugin_name . '/DataTest.txt')))
244+ Assert True(V.import('DataTest').exists())
245+ Assert True(V.import('DataTest').valid())
244246 End
245247
246248 Context wildignore handling
@@ -320,7 +322,11 @@ Describe vital
320322 End
321323
322324 It supports datafile dependencies
323- Assert True(1 == len(readfile(Filepath.join(g:testplugin_root, 'autoload/vital/' . '_' . g:testplugin_name . '/DataTest.txt'))))
325+ let V = vital#{g:testplugin_name}#new()
326+ Assert Equals(V.load('DataTest'), V)
327+ Assert True(filereadable(Filepath.join(g:testplugin_root, 'autoload/vital/' . '_' . g:testplugin_name . '/DataTest.txt')))
328+ Assert True(V.DataTest.exists())
329+ Assert True(V.DataTest.valid())
324330 End
325331
326332 Context wildignore handling
You can’t perform that action at this time.
0 commit comments