if (STRNICMP(name, "patch", 5) == 0)
{
if (name[5] == '-'
- && STRLEN(name) > 11
+ && STRLEN(name) >= 11
&& vim_isdigit(name[6])
&& vim_isdigit(name[8])
&& vim_isdigit(name[10]))
endfunction
:call TestExists()
:"
-:function TestHas()
- redir >> test.out
- for pl in ['6.9.999', '7.1.999', '7.4.123', '9.1.0', '9.9.1']
- echo 'has patch ' . pl . ': ' . has('patch-' . pl)
- endfor
- redir END
-endfunc
-:call TestHas()
-:"
:delfunc TestExists
:delfunc RunTest
:delfunc TestFuncArg
call assert_fails('echo base.method > instance.method')
endfunc
+
+func Test_version()
+ call assert_true(has('patch-7.4.001'))
+ call assert_true(has('patch-7.4.01'))
+ call assert_true(has('patch-7.4.1'))
+ call assert_true(has('patch-6.9.999'))
+ call assert_true(has('patch-7.1.999'))
+ call assert_true(has('patch-7.4.123'))
+
+ call assert_false(has('patch-7'))
+ call assert_false(has('patch-7.4'))
+ call assert_false(has('patch-7.4.'))
+ call assert_false(has('patch-9.1.0'))
+ call assert_false(has('patch-9.9.1'))
+endfunc