Mercurial > vim
comparison src/testdir/test87.ok @ 8889:8755d57debaa v7.4.1731
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Apr 14 15:56:09 2016 +0200
patch 7.4.1731
Problem: Python: turns partial into simple funcref.
Solution: Use partials like partials. (Nikolai Pavlov, closes https://github.com/vim/vim/issues/734)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 14 Apr 2016 16:00:06 +0200 |
parents | 066ef357ea91 |
children | df5f9284fcba |
comparison
equal
deleted
inserted
replaced
8888:a63c61b66a49 | 8889:8755d57debaa |
---|---|
55 [0, 1, 10, 3, 20, 5, 6, 7] | 55 [0, 1, 10, 3, 20, 5, 6, 7] |
56 [0, 1, 2, 3, 20, 5, 10, 7] | 56 [0, 1, 2, 3, 20, 5, 10, 7] |
57 [0, 1, 2, 3, 4, 5, 6, 7] | 57 [0, 1, 2, 3, 4, 5, 6, 7] |
58 [0, 1, 2, 3, 4, 5, 6, 7] | 58 [0, 1, 2, 3, 4, 5, 6, 7] |
59 [0, 1, 2, 3, 4, 5, 6, 7] | 59 [0, 1, 2, 3, 4, 5, 6, 7] |
60 l[2] threw vim.error: error:('list is locked',) | |
60 [0, 1, 2, 3] | 61 [0, 1, 2, 3] |
61 [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd'] | 62 [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd'] |
62 [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}] | 63 [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}] |
63 [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}, 'New'] | 64 [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}, 'New'] |
64 l[1](1, 2, 3):(<class 'vim.error'>, error('Vim:E725: Calling dict function without Dictionary: DictNew',)) | 65 l[1](1, 2, 3):(<class 'vim.error'>, error('Vim:E725: Calling dict function without Dictionary: DictNew',)) |
445 window:__dir__,buffer,col,cursor,height,number,options,row,tabpage,valid,vars | 446 window:__dir__,buffer,col,cursor,height,number,options,row,tabpage,valid,vars |
446 tabpage:__dir__,number,valid,vars,window,windows | 447 tabpage:__dir__,number,valid,vars,window,windows |
447 range:__dir__,append,end,start | 448 range:__dir__,append,end,start |
448 dictionary:__dir__,get,has_key,items,keys,locked,pop,popitem,scope,update,values | 449 dictionary:__dir__,get,has_key,items,keys,locked,pop,popitem,scope,update,values |
449 list:__dir__,extend,locked | 450 list:__dir__,extend,locked |
450 function:__dir__,softspace | 451 function:__dir__,args,self,softspace |
451 output:__dir__,close,flush,isatty,readable,seekable,softspace,writable,write,writelines | 452 output:__dir__,close,flush,isatty,readable,seekable,softspace,writable,write,writelines |
452 {} | 453 {} |
453 {'a': 1} | 454 {'a': 1} |
454 {'a': 1} | 455 {'a': 1} |
455 [] | 456 [] |
456 ['a', 'b', 'c', '7'] | 457 ['a', 'b', 'c', '7'] |
457 function('tr') | 458 function('tr') |
459 function('tr', [123, 3, 4]) | |
460 function('tr') | |
461 function('tr', {}) | |
462 function('tr', [123, 3, 4], {}) | |
463 a: <vim.Function 'Args'> | |
464 pa1: <vim.Function 'Args', args=['abcArgsPA1']> | |
465 pa2: <vim.Function 'Args'> | |
466 pa3: <vim.Function 'Args', args=['abcArgsPA3'], self={'abcSelfPA3': 'abcSelfPA3Val'}> | |
467 pa4: <vim.Function 'Args', self={'abcSelfPA4': 'abcSelfPA4Val'}> | |
468 sa: <vim.Function 'SelfArgs'> | |
469 psa1: <vim.Function 'SelfArgs', args=['abcArgsPSA1']> | |
470 psa2: <vim.Function 'SelfArgs'> | |
471 psa3: <vim.Function 'SelfArgs', args=['abcArgsPSA3'], self={'abcSelfPSA3': 'abcSelfPSA3Val'}> | |
472 psa4: <vim.Function 'SelfArgs', self={'abcSelfPSA4': 'abcSelfPSA4Val'}> | |
473 psar: <vim.Function 'SelfArgs', args=[{'abcArgsPSAr2': [{'rec': function('SelfArgs', [{...}], {...}), 'self': {...}, 'abcSelfPSAr': 'abcSelfPSArVal', 'args': [{...}]}, {...}], 'abcArgsPSAr': 'abcArgsPSArVal'}], self={'rec': function('SelfArgs', [{'abcArgsPSAr2': [{...}, {...}], 'abcArgsPSAr': 'abcArgsPSArVal'}], {...}), 'self': {...}, 'abcSelfPSAr': 'abcSelfPSArVal', 'args': [{...}]}> | |
474 s(a): function('Args') | |
475 s(pa1): function('Args', ['abcArgsPA1']) | |
476 s(pa2): function('Args') | |
477 s(pa3): function('Args', ['abcArgsPA3'], {'abcSelfPA3': 'abcSelfPA3Val'}) | |
478 s(pa4): function('Args', {'abcSelfPA4': 'abcSelfPA4Val'}) | |
479 s(sa): function('SelfArgs') | |
480 s(psa1): function('SelfArgs', ['abcArgsPSA1']) | |
481 s(psa2): function('SelfArgs') | |
482 s(psa3): function('SelfArgs', ['abcArgsPSA3'], {'abcSelfPSA3': 'abcSelfPSA3Val'}) | |
483 s(psa4): function('SelfArgs', {'abcSelfPSA4': 'abcSelfPSA4Val'}) | |
484 a(): !result: [] | |
485 pa1(): !result: ['abcArgsPA1'] | |
486 pa2(): !result: [] | |
487 pa3(): !result: ['abcArgsPA3'] | |
488 pa4(): !result: [] | |
489 sa(): !exception: error:('Vim:E725: Calling dict function without Dictionary: SelfArgs',) | |
490 psa1(): !exception: error:('Vim:E725: Calling dict function without Dictionary: SelfArgs',) | |
491 psa2(): !exception: error:('Vim:E725: Calling dict function without Dictionary: SelfArgs',) | |
492 psa3(): !result: [['abcArgsPSA3'], {'abcSelfPSA3': 'abcSelfPSA3Val'}] | |
493 psa4(): !result: [[], {'abcSelfPSA4': 'abcSelfPSA4Val'}] | |
494 a(42, 43): !result: [42, 43] | |
495 pa1(42, 43): !result: ['abcArgsPA1', 42, 43] | |
496 pa2(42, 43): !result: [42, 43] | |
497 pa3(42, 43): !result: ['abcArgsPA3', 42, 43] | |
498 pa4(42, 43): !result: [42, 43] | |
499 sa(42, 43): !exception: error:('Vim:E725: Calling dict function without Dictionary: SelfArgs',) | |
500 psa1(42, 43): !exception: error:('Vim:E725: Calling dict function without Dictionary: SelfArgs',) | |
501 psa2(42, 43): !exception: error:('Vim:E725: Calling dict function without Dictionary: SelfArgs',) | |
502 psa3(42, 43): !result: [['abcArgsPSA3', 42, 43], {'abcSelfPSA3': 'abcSelfPSA3Val'}] | |
503 psa4(42, 43): !result: [[42, 43], {'abcSelfPSA4': 'abcSelfPSA4Val'}] | |
504 a(42, self={"20": 1}): !result: [42] | |
505 pa1(42, self={"20": 1}): !result: ['abcArgsPA1', 42] | |
506 pa2(42, self={"20": 1}): !result: [42] | |
507 pa3(42, self={"20": 1}): !result: ['abcArgsPA3', 42] | |
508 pa4(42, self={"20": 1}): !result: [42] | |
509 sa(42, self={"20": 1}): !result: [[42], {'20': 1}] | |
510 psa1(42, self={"20": 1}): !result: [['abcArgsPSA1', 42], {'20': 1}] | |
511 psa2(42, self={"20": 1}): !result: [[42], {'20': 1}] | |
512 psa3(42, self={"20": 1}): !result: [['abcArgsPSA3', 42], {'20': 1}] | |
513 psa4(42, self={"20": 1}): !result: [[42], {'20': 1}] | |
514 a(self={"20": 1}): !result: [] | |
515 pa1(self={"20": 1}): !result: ['abcArgsPA1'] | |
516 pa2(self={"20": 1}): !result: [] | |
517 pa3(self={"20": 1}): !result: ['abcArgsPA3'] | |
518 pa4(self={"20": 1}): !result: [] | |
519 sa(self={"20": 1}): !result: [[], {'20': 1}] | |
520 psa1(self={"20": 1}): !result: [['abcArgsPSA1'], {'20': 1}] | |
521 psa2(self={"20": 1}): !result: [[], {'20': 1}] | |
522 psa3(self={"20": 1}): !result: [['abcArgsPSA3'], {'20': 1}] | |
523 psa4(self={"20": 1}): !result: [[], {'20': 1}] | |
524 a.args: None | |
525 pa1.args: ['abcArgsPA1'] | |
526 pa2.args: None | |
527 pa3.args: ['abcArgsPA3'] | |
528 pa4.args: None | |
529 sa.args: None | |
530 psa1.args: ['abcArgsPSA1'] | |
531 psa2.args: None | |
532 psa3.args: ['abcArgsPSA3'] | |
533 psa4.args: None | |
534 a.self: None | |
535 pa1.self: None | |
536 pa2.self: None | |
537 pa3.self: {'abcSelfPA3': 'abcSelfPA3Val'} | |
538 pa4.self: {'abcSelfPA4': 'abcSelfPA4Val'} | |
539 sa.self: None | |
540 psa1.self: None | |
541 psa2.self: None | |
542 psa3.self: {'abcSelfPSA3': 'abcSelfPSA3Val'} | |
543 psa4.self: {'abcSelfPSA4': 'abcSelfPSA4Val'} | |
544 a.name: 'Args' | |
545 pa1.name: 'Args' | |
546 pa2.name: 'Args' | |
547 pa3.name: 'Args' | |
548 pa4.name: 'Args' | |
549 sa.name: 'SelfArgs' | |
550 psa1.name: 'SelfArgs' | |
551 psa2.name: 'SelfArgs' | |
552 psa3.name: 'SelfArgs' | |
553 psa4.name: 'SelfArgs' | |
458 ' | 554 ' |
459 abcdef | 555 abcdef |
460 line : | 556 Error detected while processing function RunTest[]..Test: |
557 line : | |
461 abcdef | 558 abcdef |
462 abcA | 559 abcA |
463 line : | 560 line : |
464 abcB' | 561 abcB' |
465 ['a', 'dup_a'] | 562 ['a', 'dup_a'] |
466 ['a', 'a'] | 563 ['a', 'a'] |
467 ['a', 'b', 'c', 'C'] | 564 ['a', 'b', 'c', 'C'] |
468 [2, 2] | 565 [2, 2] |
1044 del l.locked:(<class 'AttributeError'>, AttributeError('cannot delete vim.List attributes',)) | 1141 del l.locked:(<class 'AttributeError'>, AttributeError('cannot delete vim.List attributes',)) |
1045 l.locked = FailingTrue():(<class 'NotImplementedError'>, NotImplementedError('bool',)) | 1142 l.locked = FailingTrue():(<class 'NotImplementedError'>, NotImplementedError('bool',)) |
1046 l.xxx = True:(<class 'AttributeError'>, AttributeError('cannot set attribute xxx',)) | 1143 l.xxx = True:(<class 'AttributeError'>, AttributeError('cannot set attribute xxx',)) |
1047 > Function | 1144 > Function |
1048 >> FunctionConstructor | 1145 >> FunctionConstructor |
1146 >>> FunctionConstructor | |
1049 vim.Function("123"):(<class 'ValueError'>, ValueError('unnamed function 123 does not exist',)) | 1147 vim.Function("123"):(<class 'ValueError'>, ValueError('unnamed function 123 does not exist',)) |
1050 vim.Function("xxx_non_existent_function_xxx"):(<class 'ValueError'>, ValueError('function xxx_non_existent_function_xxx does not exist',)) | 1148 vim.Function("xxx_non_existent_function_xxx"):(<class 'ValueError'>, ValueError('function xxx_non_existent_function_xxx does not exist',)) |
1051 vim.Function("xxx#non#existent#function#xxx"):NOT FAILED | 1149 vim.Function("xxx#non#existent#function#xxx"):NOT FAILED |
1150 vim.Function("xxx_non_existent_function_xxx2", args=[]):(<class 'ValueError'>, ValueError('function xxx_non_existent_function_xxx2 does not exist',)) | |
1151 vim.Function("xxx_non_existent_function_xxx3", self={}):(<class 'ValueError'>, ValueError('function xxx_non_existent_function_xxx3 does not exist',)) | |
1152 vim.Function("xxx_non_existent_function_xxx4", args=[], self={}):(<class 'ValueError'>, ValueError('function xxx_non_existent_function_xxx4 does not exist',)) | |
1153 >>> FunctionNew | |
1154 vim.Function("tr", self="abcFuncSelf"):(<class 'AttributeError'>, AttributeError('keys',)) | |
1155 vim.Function("tr", args=427423):(<class 'TypeError'>, TypeError('unable to convert int to vim list',)) | |
1156 vim.Function("tr", self="abcFuncSelf2", args="abcFuncArgs2"):(<class 'AttributeError'>, AttributeError('keys',)) | |
1157 vim.Function(self="abcFuncSelf2", args="abcFuncArgs2"):(<class 'AttributeError'>, AttributeError('keys',)) | |
1158 vim.Function("tr", "", self="abcFuncSelf2", args="abcFuncArgs2"):(<class 'AttributeError'>, AttributeError('keys',)) | |
1159 vim.Function("tr", ""):(<class 'TypeError'>, TypeError('function takes exactly 1 argument (2 given)',)) | |
1052 >> FunctionCall | 1160 >> FunctionCall |
1053 >>> Testing StringToChars using f({%s : 1}) | 1161 >>> Testing StringToChars using f({%s : 1}) |
1054 f({1 : 1}):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',)) | 1162 f({1 : 1}):(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',)) |
1055 f({b"\0" : 1}):(<class 'TypeError'>, TypeError('expected bytes with no null',)) | 1163 f({b"\0" : 1}):(<class 'TypeError'>, TypeError('expected bytes with no null',)) |
1056 f({"\0" : 1}):(<class 'TypeError'>, TypeError('expected bytes with no null',)) | 1164 f({"\0" : 1}):(<class 'TypeError'>, TypeError('expected bytes with no null',)) |