robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
5c22feac06
master
1" Test that the methods used for testing work. 2 3source check.vim 4source term_util.vim 5 6func Test_assert_false () 7call assert_equal ( 0 , assert_false ( 0 )) 8call assert_equal ( 0 , assert_false ( v: false )) 9call assert_equal ( 0 , v: false ->assert_false ()) 10 11call assert_equal ( 1 , assert_false ( 123 )) 12call assert_match ( "Expected False but got 123" , v: errors [ 0 ]) 13call remove ( v: errors , 0 ) 14 15call assert_equal ( 1 , 123 ->assert_false ()) 16call assert_match ( "Expected False but got 123" , v: errors [ 0 ]) 17call remove ( v: errors , 0 ) 18endfunc 19 20func Test_assert_true () 21call assert_equal ( 0 , assert_true ( 1 )) 22call assert_equal ( 0 , assert_true ( 123 )) 23call assert_equal ( 0 , assert_true ( v: true )) 24call assert_equal ( 0 , v: true ->assert_true ()) 25 26call assert_equal ( 1 , assert_true ( 0 )) 27call assert_match ( "Expected True but got 0" , v: errors [ 0 ]) 28call remove ( v: errors , 0 ) 29 30call assert_equal ( 1 , 0 ->assert_true ()) 31call assert_match ( "Expected True but got 0" , v: errors [ 0 ]) 32call remove ( v: errors , 0 ) 33endfunc 34 35func Test_assert_equal () 36let s = 'foo' 37call assert_equal ( 0 , assert_equal ( 'foo' , s )) 38let n = 4 39call assert_equal ( 0 , assert_equal ( 4 , n )) 40let l = [ 1 , 2 , 3 ] 41call assert_equal ( 0 , assert_equal ([ 1 , 2 , 3 ], l )) 42call assert_equal ( v: _null_list , v: _null_list ) 43call assert_equal ( v: _null_list , []) 44call assert_equal ([], v: _null_list ) 45 46let s = 'foo' 47call assert_equal ( 1 , assert_equal ( 'bar' , s )) 48call assert_match ( "Expected 'bar' but got 'foo'" , v: errors [ 0 ]) 49call remove ( v: errors , 0 ) 50 51let s = 'αβγ' 52call assert_equal ( 1 , assert_equal ( 'δεζ' , s )) 53call assert_match ( "Expected 'δεζ' but got 'αβγ'" , v: errors [ 0 ]) 54call remove ( v: errors , 0 ) 55 56call assert_equal ( 'XxxxxxxxxxxxxxxxxxxxxxX' , 'XyyyyyyyyyyyyyyyyyyyyyyyyyX' ) 57call assert_match ( "Expected 'X\\\\\\[x occurs 21 times]X' but got 'X\\\\\\[y occurs 25 times]X'" , v: errors [ 0 ]) 58call remove ( v: errors , 0 ) 59 60call assert_equal ( 'ΩωωωωωωωωωωωωωωωωωωωωωΩ' , 'ΩψψψψψψψψψψψψψψψψψψψψψψψψψΩ' ) 61call assert_match ( "Expected 'Ω\\\\\\[ω occurs 21 times]Ω' but got 'Ω\\\\\\[ψ occurs 25 times]Ω'" , v: errors [ 0 ]) 62call remove ( v: errors , 0 ) 63 64" special characters are escaped 65call assert_equal ( "\b\e\f\n\t\r\\\x01\x7f" , 'x' ) 66call assert_match ( 'Expected ''\\b\\e\\f\\n\\t\\r\\\\\\x01\\x7f'' but got ''x''' , v: errors [ 0 ]) 67call remove ( v: errors , 0 ) 68 69" many composing characters are handled properly 70call setline ( 1 , ' ' ) 71norm 100gr݀ 72call assert_equal ( 1 , getline ( 1 )) 73call assert_match ( "Expected 1 but got '.* occurs 100 times]'" , v: errors [ 0 ]) 74call remove ( v: errors , 0 ) 75bwipe ! 76endfunc 77 78func Test_assert_equal_dict () 79call assert_equal ( 0 , assert_equal (#{ one : 1 , two : 2 }, #{ two : 2 , one : 1 })) 80 81call assert_equal ( 1 , assert_equal (#{ one : 1 , two : 2 }, #{ two : 2 , one : 3 })) 82call assert_match ( "Expected {'one': 1} but got {'one': 3} - 1 equal item omitted" , v: errors [ 0 ]) 83call remove ( v: errors , 0 ) 84 85call assert_equal ( 1 , assert_equal (#{ one : 1 , two : 2 }, #{ two : 22 , one : 11 })) 86call assert_match ( "Expected {'one': 1, 'two': 2} but got {'one': 11, 'two': 22}" , v: errors [ 0 ]) 87call remove ( v: errors , 0 ) 88 89call assert_equal ( 1 , assert_equal (#{}, #{ two : 2 , one : 1 })) 90call assert_match ( "Expected {} but got {'one': 1, 'two': 2}" , v: errors [ 0 ]) 91call remove ( v: errors , 0 ) 92 93call assert_equal ( 1 , assert_equal (#{ two : 2 , one : 1 }, #{})) 94call assert_match ( "Expected {'one': 1, 'two': 2} but got {}" , v: errors [ 0 ]) 95call remove ( v: errors , 0 ) 96endfunc 97 98func Test_assert_equalfile () 99call assert_equal ( 1 , assert_equalfile ( 'abcabc' , 'xyzxyz' )) 100call assert_match ( "E485: Can't read file abcabc" , v: errors [ 0 ]) 101call remove ( v: errors , 0 ) 102 103let goodtext = [ "one" , "two" , "three" ] 104call writefile ( goodtext , 'Xone' , 'D' ) 105call assert_equal ( 1 , 'Xone' ->assert_equalfile ( 'xyzxyz' )) 106call assert_match ( "E485: Can't read file xyzxyz" , v: errors [ 0 ]) 107call remove ( v: errors , 0 ) 108 109call writefile ( goodtext , 'Xtwo' , 'D' ) 110call assert_equal ( 0 , assert_equalfile ( 'Xone' , 'Xtwo' )) 111 112call writefile ([ goodtext [ 0 ]], 'Xone' ) 113call assert_equal ( 1 , assert_equalfile ( 'Xone' , 'Xtwo' )) 114call assert_match ( "first file is shorter" , v: errors [ 0 ]) 115call remove ( v: errors , 0 ) 116 117call writefile ( goodtext , 'Xone' ) 118call writefile ([ goodtext [ 0 ]], 'Xtwo' ) 119call assert_equal ( 1 , assert_equalfile ( 'Xone' , 'Xtwo' )) 120call assert_match ( "second file is shorter" , v: errors [ 0 ]) 121call remove ( v: errors , 0 ) 122 123call writefile ([ '1234X89' ], 'Xone' ) 124call writefile ([ '1234Y89' ], 'Xtwo' ) 125call assert_equal ( 1 , assert_equalfile ( 'Xone' , 'Xtwo' )) 126call assert_match ( 'difference at byte 4, line 1 after "1234X" vs "1234Y"' , v: errors [ 0 ]) 127call remove ( v: errors , 0 ) 128 129call writefile ([ repeat ( 'x' , 234 ) .. 'X' ], 'Xone' ) 130call writefile ([ repeat ( 'x' , 234 ) .. 'Y' ], 'Xtwo' ) 131call assert_equal ( 1 , assert_equalfile ( 'Xone' , 'Xtwo' )) 132let xes = repeat ( 'x' , 134 ) 133call assert_match ( 'difference at byte 234, line 1 after "' .. xes .. 'X" vs "' .. xes .. 'Y"' , v: errors [ 0 ]) 134call remove ( v: errors , 0 ) 135 136call assert_equal ( 1 , assert_equalfile ( 'Xone' , 'Xtwo' , 'a message' )) 137call assert_match ( "a message: difference at byte 234, line 1 after" , v: errors [ 0 ]) 138call remove ( v: errors , 0 ) 139endfunc 140 141func Test_assert_notequal () 142let n = 4 143call assert_equal ( 0 , assert_notequal ( 'foo' , n )) 144let s = 'foo' 145call assert_equal ( 0 , assert_notequal ([ 1 , 2 , 3 ], s )) 146 147call assert_equal ( 1 , assert_notequal ( 'foo' , s )) 148call assert_match ( "Expected not equal to 'foo'" , v: errors [ 0 ]) 149call remove ( v: errors , 0 ) 150endfunc 151 152func Test_assert_report () 153call assert_equal ( 1 , assert_report ( 'something is wrong' )) 154call assert_match ( 'something is wrong' , v: errors [ 0 ]) 155call remove ( v: errors , 0 ) 156call assert_equal ( 1 , 'also wrong' ->assert_report ()) 157call assert_match ( 'also wrong' , v: errors [ 0 ]) 158call remove ( v: errors , 0 ) 159endfunc 160 161func Test_assert_exception () 162try 163nocommand 164catch 165call assert_equal ( 0 , assert_exception ( 'E492:' )) 166endtry 167 168try 169nocommand 170catch 171call assert_equal ( 1 , assert_exception ( 'E12345:' )) 172endtry 173call assert_match ( "Expected 'E12345:' but got 'Vim:E492: " , v: errors [ 0 ]) 174call remove ( v: errors , 0 ) 175 176try 177nocommand 178catch 179try 180" illegal argument, get NULL for error 181call assert_equal ( 1 , assert_exception ([])) 182catch 183call assert_equal ( 0 , assert_exception ( 'E730:' )) 184endtry 185endtry 186 187call assert_equal ( 1 , assert_exception ( 'E492:' )) 188call assert_match ( 'v:exception is not set' , v: errors [ 0 ]) 189call remove ( v: errors , 0 ) 190endfunc 191 192func Test_wrong_error_type () 193let save_verrors = v: errors 194let v:[ 'errors' ] = { 'foo' : 3 } 195call assert_equal ( 'yes' , 'no' ) 196let verrors = v: errors 197let v: errors = save_verrors 198call assert_equal ( type ([]), type ( verrors )) 199endfunc 200 201func Test_compare_fail () 202let s: v = {} 203let s: x = { "a" : s: v } 204let s: v [ "b" ] = s: x 205let s: w = { "c" : s: x , "d" : '' } 206try 207call assert_equal ( s: w , '' ) 208catch 209call assert_equal ( 0 , assert_exception ( 'E724:' )) 210" Nvim: expected value isn't shown as NULL 211" call assert_match("Expected NULL but got ''", v:errors[0]) 212call assert_match ( "Expected .* but got ''" , v: errors [ 0 ]) 213call remove ( v: errors , 0 ) 214endtry 215endfunc 216 217func Test_match () 218call assert_equal ( 0 , assert_match ( '^f.*b.*r$' , 'foobar' )) 219 220call assert_equal ( 1 , assert_match ( 'bar.*foo' , 'foobar' )) 221call assert_match ( "Pattern 'bar.*foo' does not match 'foobar'" , v: errors [ 0 ]) 222call remove ( v: errors , 0 ) 223 224call assert_equal ( 1 , assert_match ( 'bar.*foo' , 'foobar' , 'wrong' )) 225call assert_match ( 'wrong' , v: errors [ 0 ]) 226call remove ( v: errors , 0 ) 227 228call assert_equal ( 1 , 'foobar' ->assert_match ( 'bar.*foo' , 'wrong' )) 229call assert_match ( 'wrong' , v: errors [ 0 ]) 230call remove ( v: errors , 0 ) 231endfunc 232 233func Test_notmatch () 234call assert_equal ( 0 , assert_notmatch ( 'foo' , 'bar' )) 235call assert_equal ( 0 , assert_notmatch ( '^foobar$' , 'foobars' )) 236 237call assert_equal ( 1 , assert_notmatch ( 'foo' , 'foobar' )) 238call assert_match ( "Pattern 'foo' does match 'foobar'" , v: errors [ 0 ]) 239call remove ( v: errors , 0 ) 240 241call assert_equal ( 1 , 'foobar' ->assert_notmatch ( 'foo' )) 242call assert_match ( "Pattern 'foo' does match 'foobar'" , v: errors [ 0 ]) 243call remove ( v: errors , 0 ) 244endfunc 245 246func Test_assert_fail_fails () 247call assert_equal ( 1 , assert_fails ( 'xxx' , 'E12345' )) 248call assert_match ( "Expected 'E12345' but got 'E492:" , v: errors [ 0 ]) 249call remove ( v: errors , 0 ) 250 251call assert_equal ( 1 , assert_fails ( 'xxx' , 'E9876' , 'stupid' )) 252call assert_match ( "stupid: Expected 'E9876' but got 'E492:" , v: errors [ 0 ]) 253call remove ( v: errors , 0 ) 254 255call assert_equal ( 1 , assert_fails ( 'xxx' , [ 'E9876' ])) 256call assert_match ( "Expected 'E9876' but got 'E492:" , v: errors [ 0 ]) 257call remove ( v: errors , 0 ) 258 259call assert_equal ( 1 , assert_fails ( 'xxx' , [ 'E492:' , 'E9876' ])) 260call assert_match ( "Expected 'E9876' but got 'E492:" , v: errors [ 0 ]) 261call remove ( v: errors , 0 ) 262 263call assert_equal ( 1 , assert_fails ( 'echo' , '' , 'echo command' )) 264call assert_match ( "command did not fail: echo command" , v: errors [ 0 ]) 265call remove ( v: errors , 0 ) 266 267call assert_equal ( 1 , 'echo' ->assert_fails ( '' , 'echo command' )) 268call assert_match ( "command did not fail: echo command" , v: errors [ 0 ]) 269call remove ( v: errors , 0 ) 270 271try 272call assert_equal ( 1 , assert_fails ( 'xxx' , [])) 273catch 274let exp = v: exception 275endtry 276call assert_match ( "E856: \"assert_fails()\" second argument" , exp ) 277 278try 279call assert_equal ( 1 , assert_fails ( 'xxx' , [ '1' , '2' , '3' ])) 280catch 281let exp = v: exception 282endtry 283call assert_match ( "E856: \"assert_fails()\" second argument" , exp ) 284 285try 286call assert_equal ( 1 , assert_fails ( 'xxx' , v: _null_list )) 287catch 288let exp = v: exception 289endtry 290call assert_match ( "E856: \"assert_fails()\" second argument" , exp ) 291 292try 293call assert_equal ( 1 , assert_fails ( 'xxx' , [])) 294catch 295let exp = v: exception 296endtry 297call assert_match ( "E856: \"assert_fails()\" second argument" , exp ) 298 299try 300call assert_equal ( 1 , assert_fails ( 'xxx' , #{ one : 1 })) 301catch 302let exp = v: exception 303endtry 304call assert_match ( "E1222: String or List required for argument 2" , exp ) 305 306try 307call assert_equal ( 0 , assert_fails ( 'xxx' , [#{ one : 1 }])) 308catch 309let exp = v: exception 310endtry 311call assert_match ( "E731: Using a Dictionary as a String" , exp ) 312 313let exp = '' 314try 315call assert_equal ( 0 , assert_fails ( 'xxx' , [ 'E492' , #{ one : 1 }])) 316catch 317let exp = v: exception 318endtry 319call assert_match ( "E731: Using a Dictionary as a String" , exp ) 320 321try 322call assert_equal ( 1 , assert_fails ( 'xxx' , 'E492' , '' , 'burp' )) 323catch 324let exp = v: exception 325endtry 326call assert_match ( "E1210: Number required for argument 4" , exp ) 327 328try 329call assert_equal ( 1 , assert_fails ( 'xxx' , 'E492' , '' , 54 , 123 )) 330catch 331let exp = v: exception 332endtry 333call assert_match ( "E1174: String required for argument 5" , exp ) 334 335call assert_equal ( 1 , assert_fails ( 'c0' , [ '' , '\(.\)\1' ])) 336call assert_match ( "Expected '\\\\\\\\(.\\\\\\\\)\\\\\\\\1' but got 'E939: Positive count required: c0': c0" , v: errors [ 0 ]) 337call remove ( v: errors , 0 ) 338 339" Test for matching the line number and the script name in an error message 340call writefile ([ '' , 'call Xnonexisting()' ], 'Xassertfails.vim' , 'D' ) 341call assert_fails ( 'source Xassertfails.vim' , 'E117:' , '' , 10 ) 342call assert_match ( "Expected 10 but got 2" , v: errors [ 0 ]) 343call remove ( v: errors , 0 ) 344call assert_fails ( 'source Xassertfails.vim' , 'E117:' , '' , 2 , 'Xabc' ) 345call assert_match ( "Expected 'Xabc' but got .*Xassertfails.vim" , v: errors [ 0 ]) 346call remove ( v: errors , 0 ) 347endfunc 348 349func Test_assert_wrong_arg_emsg_off () 350CheckFeature folding 351 352new 353call setline ( 1 , [ 'foo' , 'bar' ]) 3541 , 2 fold 355 356" This used to crash Vim 357let & l: foldtext = 'assert_match({}, {})' 358redraw ! 359 360let & l: foldtext = 'assert_equalfile({}, {})' 361redraw ! 362 363bwipe ! 364endfunc 365 366func Test_assert_fails_in_try_block () 367try 368call assert_equal ( 0 , assert_fails ( 'throw "error"' )) 369endtry 370endfunc 371 372" Test that assert_fails() in a timer does not cause a hit-enter prompt. 373" Requires using a terminal, in regular tests the hit-enter prompt won't be 374" triggered. 375func Test_assert_fails_in_timer () 376CheckRunVimInTerminal 377 378let buf = RunVimInTerminal ( '' , { 'rows' : 6 }) 379let cmd = ":call timer_start(0, {-> assert_fails('call', 'E471:')})" 380call term_sendkeys ( buf , cmd ) 381call WaitForAssert ({ ->assert_equal ( cmd , term_getline ( buf , 6 ))}) 382call term_sendkeys ( buf , "\<CR>" ) 383call TermWait ( buf , 100 ) 384call assert_match ( 'E471: Argument required' , term_getline ( buf , 6 )) 385 386call StopVimInTerminal ( buf ) 387endfunc 388 389" Check that a typed assert_equal() doesn't prepend an unnecessary ':'. 390func Test_assert_equal_typed () 391let after =<< trim END 392call feedkeys(":call assert_equal(0, 1)\<CR>", 't') 393call feedkeys(":call writefile(v:errors, 'Xerrors')\<CR>", 't') 394call feedkeys(":qa!\<CR>", 't') 395END 396call assert_equal ( 1 , RunVim ([], after , '' )) 397call assert_equal ([ 'Expected 0 but got 1' ], readfile ( 'Xerrors' )) 398 399call delete ( 'Xerrors' ) 400endfunc 401 402func Test_assert_beeps () 403new 404call assert_equal ( 0 , assert_beeps ( 'normal h' )) 405 406call assert_equal ( 1 , assert_beeps ( 'normal 0' )) 407call assert_match ( "command did not beep: normal 0" , v: errors [ 0 ]) 408call remove ( v: errors , 0 ) 409 410call assert_equal ( 0 , 'normal h' ->assert_beeps ()) 411call assert_equal ( 1 , 'normal 0' ->assert_beeps ()) 412call assert_match ( "command did not beep: normal 0" , v: errors [ 0 ]) 413call remove ( v: errors , 0 ) 414 415bwipe 416endfunc 417 418func Test_assert_nobeep () 419call assert_equal ( 1 , assert_nobeep ( 'normal! cr' )) 420call assert_match ( "command did beep: normal! cr" , v: errors [ 0 ]) 421call remove ( v: errors , 0 ) 422endfunc 423 424func Test_assert_inrange () 425call assert_equal ( 0 , assert_inrange ( 7 , 7 , 7 )) 426call assert_equal ( 0 , assert_inrange ( 5 , 7 , 5 )) 427call assert_equal ( 0 , assert_inrange ( 5 , 7 , 6 )) 428call assert_equal ( 0 , assert_inrange ( 5 , 7 , 7 )) 429 430call assert_equal ( 1 , assert_inrange ( 5 , 7 , 4 )) 431call assert_match ( "Expected range 5 - 7, but got 4" , v: errors [ 0 ]) 432call remove ( v: errors , 0 ) 433call assert_equal ( 1 , assert_inrange ( 5 , 7 , 8 )) 434call assert_match ( "Expected range 5 - 7, but got 8" , v: errors [ 0 ]) 435call remove ( v: errors , 0 ) 436 437call assert_equal ( 0 , 5 ->assert_inrange ( 5 , 7 )) 438call assert_equal ( 0 , 7 ->assert_inrange ( 5 , 7 )) 439call assert_equal ( 1 , 8 ->assert_inrange ( 5 , 7 )) 440call assert_match ( "Expected range 5 - 7, but got 8" , v: errors [ 0 ]) 441call remove ( v: errors , 0 ) 442 443call assert_fails ( 'call assert_inrange(1, 1)' , 'E119:' ) 444 445call assert_equal ( 0 , assert_inrange ( 7.0 , 7 , 7 )) 446call assert_equal ( 0 , assert_inrange ( 7 , 7.0 , 7 )) 447call assert_equal ( 0 , assert_inrange ( 7 , 7 , 7.0 )) 448call assert_equal ( 0 , assert_inrange ( 5 , 7 , 5.0 )) 449call assert_equal ( 0 , assert_inrange ( 5 , 7 , 6.0 )) 450call assert_equal ( 0 , assert_inrange ( 5 , 7 , 7.0 )) 451 452call assert_equal ( 1 , assert_inrange ( 5 , 7 , 4.0 )) 453call assert_match ( "Expected range 5.0 - 7.0, but got 4.0" , v: errors [ 0 ]) 454call remove ( v: errors , 0 ) 455call assert_equal ( 1 , assert_inrange ( 5 , 7 , 8.0 )) 456call assert_match ( "Expected range 5.0 - 7.0, but got 8.0" , v: errors [ 0 ]) 457call remove ( v: errors , 0 ) 458 459" Use a custom message 460call assert_equal ( 1 , assert_inrange ( 5 , 7 , 8 , "Higher" )) 461call assert_match ( "Higher: Expected range 5 - 7, but got 8" , v: errors [ 0 ]) 462call remove ( v: errors , 0 ) 463call assert_equal ( 1 , assert_inrange ( 5 , 7 , 8.0 , "Higher" )) 464call assert_match ( "Higher: Expected range 5.0 - 7.0, but got 8.0" , v: errors [ 0 ]) 465call remove ( v: errors , 0 ) 466 467" Invalid arguments 468call assert_fails ( "call assert_inrange([], 2, 3)" , 'E1219:' ) 469call assert_fails ( "call assert_inrange(1, [], 3)" , 'E1219:' ) 470call assert_fails ( "call assert_inrange(1, 2, [])" , 'E1219:' ) 471endfunc 472 473func Test_assert_with_msg () 474call assert_equal ( 'foo' , 'bar' , 'testing' ) 475call assert_match ( "testing: Expected 'foo' but got 'bar'" , v: errors [ 0 ]) 476call remove ( v: errors , 0 ) 477endfunc 478 479func Test_override () 480throw 'Skipped: Nvim does not support test_override()' 481call test_override ( 'char_avail' , 1 ) 482eval 1 ->test_override ( 'redraw' ) 483call test_override ( 'ALL' , 0 ) 484call assert_fails ( "call test_override('xxx', 1)" , 'E475:' ) 485call assert_fails ( "call test_override('redraw', 'yes')" , 'E474:' ) 486call assert_fails ( "call test_override('redraw', 'yes')" , 'E1210:' ) 487endfunc 488 489func Test_mouse_position () 490let save_mouse = & mouse 491set mouse = a 492new 493call setline ( 1 , [ 'line one' , 'line two' ]) 494call assert_equal ([ 0 , 1 , 1 , 0 ], getpos ( '.' )) 495call Ntest_setmouse ( 1 , 5 ) 496call feedkeys ( "\<LeftMouse>" , "xt" ) 497call assert_equal ([ 0 , 1 , 5 , 0 ], getpos ( '.' )) 498call Ntest_setmouse ( 2 , 20 ) 499call feedkeys ( "\<LeftMouse>" , "xt" ) 500call assert_equal ([ 0 , 2 , 8 , 0 ], getpos ( '.' )) 501call Ntest_setmouse ( 5 , 1 ) 502call feedkeys ( "\<LeftMouse>" , "xt" ) 503call assert_equal ([ 0 , 2 , 1 , 0 ], getpos ( '.' )) 504bwipe ! 505let & mouse = save_mouse 506endfunc 507 508" Test for the test_alloc_fail() function 509func Test_test_alloc_fail () 510throw 'Skipped: Nvim does not support test_alloc_fail()' 511call assert_fails ( 'call test_alloc_fail([], 1, 1)' , 'E474:' ) 512call assert_fails ( 'call test_alloc_fail(10, [], 1)' , 'E474:' ) 513call assert_fails ( 'call test_alloc_fail(10, 1, [])' , 'E474:' ) 514call assert_fails ( 'call test_alloc_fail(999999, 1, 1)' , 'E474:' ) 515endfunc 516 517" Test for the test_option_not_set() function 518func Test_test_option_not_set () 519throw 'Skipped: Nvim does not support test_option_not_set()' 520call assert_fails ( 'call test_option_not_set("Xinvalidopt")' , 'E475:' ) 521endfunc 522 523" Must be last. 524func Test_zz_quit_detected () 525" Verify that if a test function ends Vim the test script detects this. 526quit 527endfunc