mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	| @@ -10658,7 +10658,7 @@ static void f_has(typval_T *argvars, typval_T *rettv, FunPtr fptr) | ||||
|   if (!n) { | ||||
|     if (STRNICMP(name, "patch", 5) == 0) { | ||||
|       if (name[5] == '-' | ||||
|           && strlen(name) > 11 | ||||
|           && strlen(name) >= 11 | ||||
|           && ascii_isdigit(name[6]) | ||||
|           && ascii_isdigit(name[8]) | ||||
|           && ascii_isdigit(name[10])) { | ||||
|   | ||||
| @@ -1,5 +1,20 @@ | ||||
| " Tests for expressions. | ||||
|  | ||||
| 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 | ||||
|  | ||||
| func Test_strgetchar() | ||||
|   call assert_equal(char2nr('a'), strgetchar('axb', 0)) | ||||
|   call assert_equal(char2nr('x'), strgetchar('axb', 1)) | ||||
|   | ||||
| @@ -784,7 +784,7 @@ static int included_patches[] = { | ||||
|   1663, | ||||
|   // 1662 NA | ||||
|   // 1661 NA | ||||
|   // 1660, | ||||
|   1660, | ||||
|   // 1659 NA | ||||
|   1658, | ||||
|   // 1657 NA | ||||
|   | ||||
| @@ -638,15 +638,6 @@ describe('exists() and has() functions', function() | ||||
|  | ||||
|       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() | ||||
|  | ||||
|       edit! test.out | ||||
|       set ff=unix | ||||
|     ]=]) | ||||
| @@ -858,12 +849,7 @@ describe('exists() and has() functions', function() | ||||
|       OK | ||||
|        g:footest#x = 1 | ||||
|          footest#F() 0 | ||||
|       UndefFun() 0 | ||||
|       has patch 6.9.999: 1 | ||||
|       has patch 7.1.999: 1 | ||||
|       has patch 7.4.123: 1 | ||||
|       has patch 9.1.0: 0 | ||||
|       has patch 9.9.1: 0]]) | ||||
|       UndefFun() 0]]) | ||||
|  | ||||
|   end) | ||||
| end) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 James McCoy
					James McCoy