robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
aa1d8a2702
master
1-- ShaDa errors handling support 2local t =require ( 'test.testutil' ) 3local n =require ( 'test.functional.testnvim' )() 4local t_shada =require ( 'test.functional.shada.testutil' ) 5 6local describe , it , before_each , after_each =t . describe , t . it , t . before_each , t . after_each 7local nvim_command , eq =n . command , t . eq 8local reset , clear , get_shada_rw =t_shada . reset , t_shada . clear , t_shada . get_shada_rw 9 10local wshada , sdrcmd , shada_fname , clean =get_shada_rw ( 'Xtest-functional-shada-errors.shada' ) 11 12describe ( 'ShaDa error handling' , function () 13before_each ( reset ) 14after_each ( function () 15clear () 16clean () 17end ) 18 19-- Note: most of tests have additional items like sX, mX, rX. These are for 20-- valgrind tests, to check for memory leaks (i.e. whether error handling code 21-- does (not) forget to call ga_clear). Not needed for array-based items like 22-- history because they are not using ad_ga. 23 24it ( 'does not fail on empty file' , function () 25wshada ( '' ) 26nvim_command ( sdrcmd ()) 27end ) 28 29it ( 'fails on zero' , function () 30wshada ( '\000' ) 31eq ( 32'Vim(rshada):E576: Error while reading ShaDa file: expected positive integer at position 1, but got nothing' , 33t . pcall_err ( nvim_command , sdrcmd ()) 34) 35end ) 36 37it ( 'fails on missing item' , function () 38wshada ( '\000\000\000' ) 39eq ( 40'Vim(rshada):E576: Error while reading ShaDa file: there is an item at position 0 that must not be there: Missing items are for internal uses only' , 41t . pcall_err ( nvim_command , sdrcmd ()) 42) 43end ) 44 45it ( 'fails on -2 type' , function () 46wshada ( '\254\000\000' ) 47eq ( 48'Vim(rshada):E576: Error while reading ShaDa file: expected positive integer at position 0' , 49t . pcall_err ( nvim_command , sdrcmd ()) 50) 51end ) 52 53it ( 'does not fail on header with zero length' , function () 54-- Header items are skipped when reading. 55wshada ( '\001\000\000' ) 56nvim_command ( sdrcmd ()) 57end ) 58 59it ( 'fails on search pattern item with zero length' , function () 60wshada ( '\002\000\000' ) 61eq ( 62'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 is not a dict' , 63t . pcall_err ( nvim_command , sdrcmd ()) 64) 65end ) 66 67it ( 'fails on search pattern item with -2 timestamp' , function () 68wshada ( '\002\254\000' ) 69eq ( 70'Vim(rshada):E576: Error while reading ShaDa file: expected positive integer at position 1' , 71t . pcall_err ( nvim_command , sdrcmd ()) 72) 73end ) 74 75it ( 'fails on search pattern item with -2 length' , function () 76wshada ( '\002\000\254' ) 77eq ( 78'Vim(rshada):E576: Error while reading ShaDa file: expected positive integer at position 2' , 79t . pcall_err ( nvim_command , sdrcmd ()) 80) 81end ) 82 83it ( 'fails on search pattern item with length greater then file length' , function () 84wshada ( '\002\000\002\000' ) 85eq ( 86'Vim(rshada):E576: Error while reading ShaDa file: last entry specified that it occupies 2 bytes, but file ended earlier' , 87t . pcall_err ( nvim_command , sdrcmd ()) 88) 89end ) 90 91it ( 'fails on search pattern item with invalid byte' , function () 92-- 195 (== 0xC1) cannot start any valid messagepack entry (the only byte 93-- that cannot do this) 94wshada ( '\002\000\001\193' ) 95eq ( 96'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 is not a dict' , 97t . pcall_err ( nvim_command , sdrcmd ()) 98) 99end ) 100 101it ( 'fails on search pattern item with incomplete map' , function () 102wshada ( '\002\000\001\129' ) 103eq ( 104'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 has key value which is not a string' , 105t . pcall_err ( nvim_command , sdrcmd ()) 106) 107end ) 108 109it ( 'fails on search pattern item without a pattern' , function () 110wshada ( '\002\000\005\129\162sX\192' ) 111eq ( 112'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 has no pattern' , 113t . pcall_err ( nvim_command , sdrcmd ()) 114) 115end ) 116 117it ( 'fails on search pattern with extra bytes' , function () 118wshada ( '\002\000\002\128\000' ) 119eq ( 120'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 has no pattern' , 121t . pcall_err ( nvim_command , sdrcmd ()) 122) 123end ) 124 125it ( 'fails on search pattern item with NIL value' , function () 126wshada ( '\002\000\001\192' ) 127eq ( 128'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 is not a dict' , 129t . pcall_err ( nvim_command , sdrcmd ()) 130) 131end ) 132 133-- sp entry is here because it causes an allocation. 134it ( 'fails on search pattern item with empty key' , function () 135wshada ( '\002\000\013\131\162sp\196\001a\162sX\192\160\000' ) 136eq ( 137'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 has empty key' , 138t . pcall_err ( nvim_command , sdrcmd ()) 139) 140end ) 141 142it ( 'fails on search pattern item with NIL magic key value' , function () 143wshada ( '\002\000\009\130\162sX\192\162sm\192' ) 144eq ( 145'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 has sm key value which is not a boolean' , 146t . pcall_err ( nvim_command , sdrcmd ()) 147) 148end ) 149 150it ( 'fails on search pattern item with NIL smartcase key value' , function () 151wshada ( '\002\000\009\130\162sX\192\162sc\192' ) 152eq ( 153'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 has sc key value which is not a boolean' , 154t . pcall_err ( nvim_command , sdrcmd ()) 155) 156end ) 157 158it ( 'fails on search pattern item with NIL search_backward key value' , function () 159wshada ( '\002\000\009\130\162sX\192\162sb\192' ) 160eq ( 161'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 has sb key value which is not a boolean' , 162t . pcall_err ( nvim_command , sdrcmd ()) 163) 164end ) 165 166it ( 'fails on search pattern item with NIL has_line_offset key value' , function () 167wshada ( '\002\000\009\130\162sX\192\162sl\192' ) 168eq ( 169'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 has sl key value which is not a boolean' , 170t . pcall_err ( nvim_command , sdrcmd ()) 171) 172end ) 173 174it ( 'fails on search pattern item with NIL place_cursor_at_end key value' , function () 175wshada ( '\002\000\009\130\162sX\192\162se\192' ) 176eq ( 177'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 has se key value which is not a boolean' , 178t . pcall_err ( nvim_command , sdrcmd ()) 179) 180end ) 181 182it ( 'fails on search pattern item with NIL is_last_used key value' , function () 183wshada ( '\002\000\009\130\162sX\192\162su\192' ) 184eq ( 185'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 has su key value which is not a boolean' , 186t . pcall_err ( nvim_command , sdrcmd ()) 187) 188end ) 189 190it ( 'fails on search pattern item with NIL is_substitute_pattern key value' , function () 191wshada ( '\002\000\009\130\162sX\192\162ss\192' ) 192eq ( 193'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 has ss key value which is not a boolean' , 194t . pcall_err ( nvim_command , sdrcmd ()) 195) 196end ) 197 198it ( 'fails on search pattern item with NIL highlighted key value' , function () 199wshada ( '\002\000\009\130\162sX\192\162sh\192' ) 200eq ( 201'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 has sh key value which is not a boolean' , 202t . pcall_err ( nvim_command , sdrcmd ()) 203) 204end ) 205 206it ( 'fails on search pattern item with NIL offset key value' , function () 207wshada ( '\002\000\009\130\162sX\192\162so\192' ) 208eq ( 209'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 has so key value which is not an integer' , 210t . pcall_err ( nvim_command , sdrcmd ()) 211) 212end ) 213 214it ( 'fails on search pattern item with NIL pat key value' , function () 215wshada ( '\002\000\009\130\162sX\192\162sp\192' ) 216eq ( 217'Vim(rshada):E575: Error while reading ShaDa file: search pattern entry at position 0 has sp key value which is not a binary' , 218t . pcall_err ( nvim_command , sdrcmd ()) 219) 220end ) 221 222for _ , v in ipairs ( { 223{ name ='global mark' , mpack ='\007' } , 224{ name ='jump' , mpack ='\008' } , 225{ name ='local mark' , mpack ='\010' } , 226{ name ='change' , mpack ='\011' } , 227} ) do 228it ( 'fails on ' .. v . name .. ' item with NIL value' , function () 229wshada ( v . mpack .. '\000\001\192' ) 230eq ( 231'Vim(rshada):E575: Error while reading ShaDa file: mark entry at position 0 is not a dict' , 232t . pcall_err ( nvim_command , sdrcmd ()) 233) 234end ) 235 236-- f entry is here because it causes an allocation. 237it ( 'fails on ' .. v . name .. ' item with empty key' , function () 238wshada ( v . mpack .. '\000\012\131\161f\196\001/\162mX\192\160\000' ) 239eq ( 240'Vim(rshada):E575: Error while reading ShaDa file: mark entry at position 0 has empty key' , 241t . pcall_err ( nvim_command , sdrcmd ()) 242) 243end ) 244 245it ( 'fails on ' .. v . name .. ' item without f key' , function () 246wshada ( v . mpack .. '\000\008\130\162mX\192\161l\001' ) 247eq ( 248'Vim(rshada):E575: Error while reading ShaDa file: mark entry at position 0 is missing file name' , 249t . pcall_err ( nvim_command , sdrcmd ()) 250) 251end ) 252 253it ( 'fails on ' .. v . name .. ' item with zero l key' , function () 254wshada ( v . mpack .. '\000\013\131\162mX\192\161f\196\001/\161l\000' ) 255eq ( 256'Vim(rshada):E575: Error while reading ShaDa file: mark entry at position 0 has invalid line number' , 257t . pcall_err ( nvim_command , sdrcmd ()) 258) 259end ) 260 261it ( 'fails on ' .. v . name .. ' item with negative l key' , function () 262wshada ( v . mpack .. '\000\013\131\162mX\192\161f\196\001/\161l\255' ) 263eq ( 264'Vim(rshada):E575: Error while reading ShaDa file: mark entry at position 0 has invalid line number' , 265t . pcall_err ( nvim_command , sdrcmd ()) 266) 267end ) 268 269it ( 'fails on ' .. v . name .. ' item with negative c key' , function () 270wshada ( v . mpack .. '\000\013\131\162mX\192\161f\196\001/\161c\255' ) 271eq ( 272'Vim(rshada):E575: Error while reading ShaDa file: mark entry at position 0 has invalid column number' , 273t . pcall_err ( nvim_command , sdrcmd ()) 274) 275end ) 276 277it ( 'fails on ' .. v . name .. ' item with STR n key value' , function () 278wshada ( v . mpack .. '\000\011\130\162mX\192\161n\163spa' ) 279eq ( 280'Vim(rshada):E575: Error while reading ShaDa file: mark entry at position 0 has n key value which is not an integer' , 281t . pcall_err ( nvim_command , sdrcmd ()) 282) 283end ) 284 285it ( 'fails on ' .. v . name .. ' item with STR l key value' , function () 286wshada ( v . mpack .. '\000\010\130\162mX\192\161l\162sp' ) 287eq ( 288'Vim(rshada):E575: Error while reading ShaDa file: mark entry at position 0 has l key value which is not an integer' , 289t . pcall_err ( nvim_command , sdrcmd ()) 290) 291end ) 292 293it ( 'fails on ' .. v . name .. ' item with STR c key value' , function () 294wshada ( v . mpack .. '\000\010\130\162mX\192\161c\162sp' ) 295eq ( 296'Vim(rshada):E575: Error while reading ShaDa file: mark entry at position 0 has c key value which is not an integer' , 297t . pcall_err ( nvim_command , sdrcmd ()) 298) 299end ) 300end 301 302it ( 'fails on register item with NIL value' , function () 303wshada ( '\005\000\001\192' ) 304eq ( 305'Vim(rshada):E575: Error while reading ShaDa file: register entry at position 0 is not a dict' , 306t . pcall_err ( nvim_command , sdrcmd ()) 307) 308end ) 309 310-- rc entry is here because it causes an allocation 311it ( 'fails on register item with BIN key' , function () 312wshada ( '\005\000\014\131\162rc\145\196\001a\162rX\192\160\000' ) 313eq ( 314'Vim(rshada):E575: Error while reading ShaDa file: register entry at position 0 has empty key' , 315t . pcall_err ( nvim_command , sdrcmd ()) 316) 317end ) 318 319it ( 'fails on register item with NIL rt key value' , function () 320wshada ( '\005\000\009\130\162rX\192\162rt\192' ) 321eq ( 322'Vim(rshada):E575: Error while reading ShaDa file: register entry at position 0 has rt key value which is not an integer' , 323t . pcall_err ( nvim_command , sdrcmd ()) 324) 325end ) 326 327it ( 'fails on register item with NIL rw key value' , function () 328wshada ( '\005\000\009\130\162rX\192\162rw\192' ) 329eq ( 330'Vim(rshada):E575: Error while reading ShaDa file: register entry at position 0 has rw key value which is not an integer' , 331t . pcall_err ( nvim_command , sdrcmd ()) 332) 333end ) 334 335it ( 'fails on register item with NIL rc key value' , function () 336wshada ( '\005\000\009\130\162rX\192\162rc\192' ) 337eq ( 338'Vim(rshada):E575: Error while reading ShaDa file: register entry at position 0 has rc key with non-array value' , 339t . pcall_err ( nvim_command , sdrcmd ()) 340) 341end ) 342 343it ( 'fails on register item with empty rc key value' , function () 344wshada ( '\005\000\009\130\162rX\192\162rc\144' ) 345eq ( 346'Vim(rshada):E575: Error while reading ShaDa file: register entry at position 0 has rc key with missing or empty array' , 347t . pcall_err ( nvim_command , sdrcmd ()) 348) 349end ) 350 351it ( 'fails on register item with NIL in rc array' , function () 352wshada ( '\005\000\013\130\162rX\192\162rc\146\196\001a\192' ) 353eq ( 354'Vim(rshada):E575: Error while reading ShaDa file: register entry at position 0 has rc array with non-binary value' , 355t . pcall_err ( nvim_command , sdrcmd ()) 356) 357end ) 358 359it ( 'fails on register item without rc array' , function () 360wshada ( '\005\000\009\129\162rX\146\196\001a\192' ) 361eq ( 362'Vim(rshada):E575: Error while reading ShaDa file: register entry at position 0 has rc key with missing or empty array' , 363t . pcall_err ( nvim_command , sdrcmd ()) 364) 365end ) 366 367it ( 'fails on history item with NIL value' , function () 368wshada ( '\004\000\001\192' ) 369eq ( 370'Vim(rshada):E575: Error while reading ShaDa file: history entry at position 0 is not an array with enough elements' , 371t . pcall_err ( nvim_command , sdrcmd ()) 372) 373end ) 374 375it ( 'fails on history item with empty value' , function () 376wshada ( '\004\000\001\144' ) 377eq ( 378'Vim(rshada):E575: Error while reading ShaDa file: history entry at position 0 is not an array with enough elements' , 379t . pcall_err ( nvim_command , sdrcmd ()) 380) 381end ) 382 383it ( 'fails on history item with single element value' , function () 384wshada ( '\004\000\002\145\000' ) 385eq ( 386'Vim(rshada):E575: Error while reading ShaDa file: history entry at position 0 is not an array with enough elements' , 387t . pcall_err ( nvim_command , sdrcmd ()) 388) 389end ) 390 391it ( 'fails on history item with NIL first item' , function () 392wshada ( '\004\000\003\146\192\000' ) 393eq ( 394'Vim(rshada):E575: Error while reading ShaDa file: history entry at position 0 has wrong history type type' , 395t . pcall_err ( nvim_command , sdrcmd ()) 396) 397end ) 398 399it ( 'fails on history item with FIXUINT second item' , function () 400wshada ( '\004\000\003\146\000\000' ) 401eq ( 402'Vim(rshada):E575: Error while reading ShaDa file: history entry at position 0 has wrong history string type' , 403t . pcall_err ( nvim_command , sdrcmd ()) 404) 405end ) 406 407it ( 'fails on history item with truncated string' , function () 408-- The string header declares five bytes, but only four follow it. 409wshada ( '\004\000\007\146\000\165AAAA' ) 410eq ( 411'Vim(rshada):E575: Error while reading ShaDa file: history entry at position 0 has wrong history string type' , 412t . pcall_err ( nvim_command , sdrcmd ()) 413) 414end ) 415 416it ( 'fails on history item with second item with zero byte' , function () 417wshada ( '\004\000\007\146\000\196\003ab\000' ) 418eq ( 419'Vim(rshada):E575: Error while reading ShaDa file: history entry at position 0 contains string with zero byte inside' , 420t . pcall_err ( nvim_command , sdrcmd ()) 421) 422end ) 423 424it ( 'fails on search history item without third item' , function () 425wshada ( '\004\000\007\146\001\196\003abc' ) 426eq ( 427'Vim(rshada):E575: Error while reading ShaDa file: search history entry at position 0 does not have separator character' , 428t . pcall_err ( nvim_command , sdrcmd ()) 429) 430end ) 431 432it ( 'fails on search history item with NIL third item' , function () 433wshada ( '\004\000\007\147\001\196\002ab\192' ) 434eq ( 435'Vim(rshada):E575: Error while reading ShaDa file: search history entry at position 0 has wrong history separator type' , 436t . pcall_err ( nvim_command , sdrcmd ()) 437) 438end ) 439 440it ( 'fails on variable item with NIL value' , function () 441wshada ( '\006\000\001\192' ) 442eq ( 443'Vim(rshada):E575: Error while reading ShaDa file: variable entry at position 0 is not an array with enough elements' , 444t . pcall_err ( nvim_command , sdrcmd ()) 445) 446end ) 447 448it ( 'fails on variable item with empty value' , function () 449wshada ( '\006\000\001\144' ) 450eq ( 451'Vim(rshada):E575: Error while reading ShaDa file: variable entry at position 0 is not an array with enough elements' , 452t . pcall_err ( nvim_command , sdrcmd ()) 453) 454end ) 455 456it ( 'fails on variable item with single element value' , function () 457wshada ( '\006\000\002\145\000' ) 458eq ( 459'Vim(rshada):E575: Error while reading ShaDa file: variable entry at position 0 is not an array with enough elements' , 460t . pcall_err ( nvim_command , sdrcmd ()) 461) 462end ) 463 464it ( 'fails on variable item with NIL first item' , function () 465wshada ( '\006\000\003\146\192\000' ) 466eq ( 467'Vim(rshada):E575: Error while reading ShaDa file: variable entry at position 0 has wrong variable name type' , 468t . pcall_err ( nvim_command , sdrcmd ()) 469) 470end ) 471 472it ( 'fails on variable item with BIN value and type value != VAR_TYPE_BLOB' , function () 473wshada ( '\006\000\007\147\196\001\065\196\000\000' ) 474eq ( 475'Vim(rshada):E575: Error while reading ShaDa file: variable entry at position 0 has wrong variable type' , 476t . pcall_err ( nvim_command , sdrcmd ()) 477) 478end ) 479 480it ( 'fails on replacement item with NIL value' , function () 481wshada ( '\003\000\001\192' ) 482eq ( 483'Vim(rshada):E575: Error while reading ShaDa file: sub string entry at position 0 is not an array with enough elements' , 484t . pcall_err ( nvim_command , sdrcmd ()) 485) 486end ) 487 488it ( 'fails on replacement item with empty value' , function () 489wshada ( '\003\000\001\144' ) 490eq ( 491'Vim(rshada):E575: Error while reading ShaDa file: sub string entry at position 0 is not an array with enough elements' , 492t . pcall_err ( nvim_command , sdrcmd ()) 493) 494end ) 495 496it ( 'fails on replacement item with NIL first item' , function () 497wshada ( '\003\000\002\145\192' ) 498eq ( 499'Vim(rshada):E575: Error while reading ShaDa file: sub string entry at position 0 has wrong sub string type' , 500t . pcall_err ( nvim_command , sdrcmd ()) 501) 502end ) 503 504it ( 'fails on buffer list item with NIL value' , function () 505nvim_command ( 'set shada+=%' ) 506wshada ( '\009\000\001\192' ) 507eq ( 508'Vim(rshada):E575: Error while reading ShaDa file: buffer list entry at position 0 is not an array' , 509t . pcall_err ( nvim_command , sdrcmd ()) 510) 511end ) 512 513it ( 'fails on buffer list item with NIL item in the array' , function () 514nvim_command ( 'set shada+=%' ) 515wshada ( '\009\000\008\146\129\161f\196\001/\192' ) 516eq ( 517'Vim(rshada):E575: Error while reading ShaDa file: buffer list at position 0 contains entry that is not a dict' , 518t . pcall_err ( nvim_command , sdrcmd ()) 519) 520end ) 521 522it ( 'fails on buffer list item with empty item' , function () 523nvim_command ( 'set shada+=%' ) 524wshada ( '\009\000\008\146\129\161f\196\001/\128' ) 525eq ( 526'Vim(rshada):E575: Error while reading ShaDa file: buffer list at position 0 contains entry that does not have a file name' , 527t . pcall_err ( nvim_command , sdrcmd ()) 528) 529end ) 530 531it ( 'fails on buffer list item with NIL l key' , function () 532nvim_command ( 'set shada+=%' ) 533wshada ( '\009\000\017\146\129\161f\196\001/\130\161f\196\002/a\161l\192' ) 534eq ( 535'Vim(rshada):E575: Error while reading ShaDa file: buffer list at position 0 contains entry that has l key value which is not an integer' , 536t . pcall_err ( nvim_command , sdrcmd ()) 537) 538end ) 539 540it ( 'fails on buffer list item with zero l key' , function () 541nvim_command ( 'set shada+=%' ) 542wshada ( '\009\000\017\146\129\161f\196\001/\130\161f\196\002/a\161l\000' ) 543eq ( 544'Vim(rshada):E575: Error while reading ShaDa file: buffer list at position 0 contains entry with invalid line number' , 545t . pcall_err ( nvim_command , sdrcmd ()) 546) 547end ) 548 549it ( 'fails on buffer list item with negative l key' , function () 550nvim_command ( 'set shada+=%' ) 551wshada ( '\009\000\017\146\129\161f\196\001/\130\161f\196\002/a\161l\255' ) 552eq ( 553'Vim(rshada):E575: Error while reading ShaDa file: buffer list at position 0 contains entry with invalid line number' , 554t . pcall_err ( nvim_command , sdrcmd ()) 555) 556end ) 557 558it ( 'fails on buffer list item with negative c key' , function () 559nvim_command ( 'set shada+=%' ) 560wshada ( '\009\000\017\146\129\161f\196\001/\130\161f\196\002/a\161c\255' ) 561eq ( 562'Vim(rshada):E575: Error while reading ShaDa file: buffer list at position 0 contains entry with invalid column number' , 563t . pcall_err ( nvim_command , sdrcmd ()) 564) 565end ) 566 567it ( 'fails on buffer list item with NIL c key' , function () 568nvim_command ( 'set shada+=%' ) 569wshada ( '\009\000\017\146\129\161f\196\001/\130\161f\196\002/a\161c\192' ) 570eq ( 571'Vim(rshada):E575: Error while reading ShaDa file: buffer list at position 0 contains entry that has c key value which is not an integer' , 572t . pcall_err ( nvim_command , sdrcmd ()) 573) 574end ) 575 576it ( 'fails on invalid ShaDa file (viminfo file)' , function () 577wshada ( [[# This viminfo file was generated by Vim 7.4. 578# You may edit it if you're careful! 579 580# Value of 'encoding' when this file was written 581*encoding=utf-8 582 583 584# hlsearch on (H) or off (h): 585~h 586# Last Search Pattern: 587~MSle0~/buffer=abuf 588 589# Last Substitute Search Pattern: 590~MSle0&^$ 591 592# Last Substitute String: 593$ 594 595# Command Line History (newest to oldest): 596:cq 597 598# Search String History (newest to oldest): 599? \<TMUX\> 600 601# Expression History (newest to oldest): 602=system('echo "\xAB"') 603 604# Input Line History (newest to oldest): 605@i 606 607# Input Line History (newest to oldest): 608 609# Registers: 610"0 LINE 0 611case FLAG_B: puts("B"); break; 612"1 LINE 0 613pick 874a489 shada,functests: Test compatibility support 614""- CHAR 0 615. 616 617# global variables: 618!STUF_HISTORY_TRANSLIT LIS [] 619!TR3_INPUT_HISTORY LIS [] 620 621# File marks: 622'A 8320 12 ~/a.a/Proj/c/neovim-2076/src/nvim/ex_docmd.c 623'0 66 5 ~/a.a/Proj/c/neovim/.git/rebase-merge/git-rebase-todo 624'1 7 0 ~/.vam/powerline/.git/MERGE_MSG 625'2 64 4 ~/a.a/Proj/c/neovim/.git/rebase-merge/git-rebase-todo 626'3 9 0 ~/a.a/Proj/c/neovim/.git/COMMIT_EDITMSG 627'4 62 0 ~/a.a/Proj/c/neovim/.git/rebase-merge/git-rebase-todo 628'5 57 4 ~/a.a/Proj/c/neovim/.git/rebase-merge/git-rebase-todo 629'6 1 0 ~/a.a/Proj/c/neovim/.git/rebase-merge/git-rebase-todo 630'7 399 7 /usr/share/vim/vim74/doc/motion.txt 631'8 1 0 ~/a.a/Proj/c/zpython/build/CMakeFiles/3.2.2/CMakeCCompiler.cmake 632'9 1 0 ~/a.a/Proj/c/vim/README.txt 633 634# Jumplist (newest first): 635-' 66 5 ~/a.a/Proj/c/neovim/.git/rebase-merge/git-rebase-todo 636 637# History of marks within files (newest to oldest): 638 639> ~/a.a/Proj/c/neovim/.git/rebase-merge/git-rebase-todo 640" 66 5 641^ 66 6 642. 66 5 643+ 65 0 644+ 65 0 645]] ) 646eq ( 647'Vim(rshada):E576: Failed to parse ShaDa file: extra bytes in msgpack string at position 3' , 648t . pcall_err ( nvim_command , sdrcmd ()) 649) 650eq ( 651'Vim(wshada):E576: Failed to parse ShaDa file: extra bytes in msgpack string at position 3' , 652t . pcall_err ( nvim_command , 'wshada ' .. shada_fname ) 653) 654nvim_command ( 'wshada! ' .. shada_fname ) 655end ) 656 657it ( 'fails on invalid ShaDa file (wrapper script)' , function () 658wshada ( '#!/bin/sh\n\npowerline "$@" 2>&1 | tee -a powerline\n' ) 659eq ( 660'Vim(rshada):E576: Failed to parse ShaDa file: extra bytes in msgpack string at position 3' , 661t . pcall_err ( nvim_command , sdrcmd ()) 662) 663eq ( 664'Vim(wshada):E576: Failed to parse ShaDa file: extra bytes in msgpack string at position 3' , 665t . pcall_err ( nvim_command , 'wshada ' .. shada_fname ) 666) 667nvim_command ( 'wshada! ' .. shada_fname ) 668end ) 669 670it ( 'fails on invalid ShaDa file (failing skip in second item)' , function () 671wshada ( '\001\000\001\128#!/' ) 672eq ( 673'Vim(rshada):E576: Reading ShaDa file: last entry specified that it occupies 47 bytes, but file ended earlier' , 674t . pcall_err ( nvim_command , sdrcmd ()) 675) 676eq ( 677'Vim(wshada):E576: Error while reading ShaDa file: last entry specified that it occupies 47 bytes, but file ended earlier' , 678t . pcall_err ( nvim_command , 'wshada ' .. shada_fname ) 679) 680nvim_command ( 'wshada! ' .. shada_fname ) 681end ) 682 683it ( 'errors with too large items' , function () 684wshada ( { 6851 , 686206 , 68770 , 68890 , 68931 , 690179 , 69186 , 692133 , 693169 , 694103 , 695101 , 696110 , 697101 , 698114 , 69997 , 700116 , 701111 , 702114 , 703196 , 7044 , 705145 , 706145 , 707145 , 708145 , 709145 , 710145 , 71196 , 71296 , 71396 , 71496 , 71596 , 71696 , 71796 , 71896 , 71996 , 72096 , 72196 , 72296 , 72396 , 72496 , 72596 , 72696 , 72796 , 72896 , 72996 , 73096 , 73196 , 732145 , 733145 , 734145 , 735145 , 736111 , 737110 , 738196 , 73925 , 74078 , 74186 , 74273 , 74377 , 74432 , 745118 , 7461 , 74746 , 74850 , 74946 , 75048 , 75145 , 75251 , 75348 , 75451 , 75545 , 756103 , 75798 , 75854 , 75955 , 76052 , 761102 , 762100 , 76350 , 76499 , 765169 , 766109 , 76797 , 768120 , 76995 , 770107 , 77198 , 772121 , 773116 , 774101 , 77510 , 776207 , 777207 , 778207 , 779207 , 780207 , 781207 , 782207 , 783207 , 784207 , 785207 , 786207 , 787207 , 788207 , 789207 , 790207 , 791207 , 792207 , 793207 , 794207 , 795207 , 796207 , 797207 , 79816 , 7998 , 800206 , 80189 , 80290 , 80330 , 804253 , 80535 , 806129 , 807161 , 808102 , 809196 , 81030 , 81147 , 812100 , 813101 , 814118 , 81547 , 816115 , 817104 , 818109 , 81947 , 820102 , 821117 , 822122 , 823122 , 824105 , 825110 , 826103 , 82745 , 828110 , 829118 , 830105 , 831109 , 83245 , 833115 , 834104 , 83597 , 836100 , 83797 , 83847 , 839108 , 840115 , 8412 , 842206 , 84389 , 84490 , 84530 , 846251 , 84713 , 848130 , 849162 , 850115 , 851112 , 852196 , 8533 , 854102 , 855111 , 856111 , 857162 , 858115 , 85999 , 860195 , 8613 , 862146 , 86310 , 8640 , 865} ) 866eq ( 867'Vim(rshada):E576: Error while reading ShaDa file: there is an item at position 93 that is stated to be too long' , 868t . pcall_err ( nvim_command , sdrcmd ()) 869) 870end ) 871end )