Mercurial > vim
diff src/testdir/test87.ok @ 12806:ef93c4415667 v8.0.1280
patch 8.0.1280: Python None cannot be converted to a Vim type
commit https://github.com/vim/vim/commit/de323093e1be165a3eadd1ab3d02942358cd97bf
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 9 19:56:08 2017 +0100
patch 8.0.1280: Python None cannot be converted to a Vim type
Problem: Python None cannot be converted to a Vim type.
Solution: Convert it to v:none. (Ken Takata)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 09 Nov 2017 20:00:05 +0100 |
parents | 32dd27cceadd |
children | 30a0068f6167 |
line wrap: on
line diff
--- a/src/testdir/test87.ok +++ b/src/testdir/test87.ok @@ -87,7 +87,7 @@ ll:[1] ['a', 'b'] ['c', 1] ['d', ['e']] -py3eval("None") = 0 +py3eval("None") = v:none 0.0 "\0": Vim(let):E859: {"\0": 1}: Vim(let):E859: @@ -768,7 +768,7 @@ d["a"] = {"abcF" : FailingIter()}:(<clas d["a"] = {"abcF" : FailingIterNext()}:(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using d["a"] = {"abcF" : %s} -d["a"] = {"abcF" : None}:(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +d["a"] = {"abcF" : None}:NOT FAILED d["a"] = {"abcF" : {b"": 1}}:(<class 'ValueError'>, ValueError('empty keys are not allowed',)) d["a"] = {"abcF" : {"": 1}}:(<class 'ValueError'>, ValueError('empty keys are not allowed',)) d["a"] = {"abcF" : FailingMapping()}:(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -795,7 +795,7 @@ d["a"] = Mapping({"abcG" : FailingIter() d["a"] = Mapping({"abcG" : FailingIterNext()}):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abcG" : %s}) -d["a"] = Mapping({"abcG" : None}):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +d["a"] = Mapping({"abcG" : None}):NOT FAILED d["a"] = Mapping({"abcG" : {b"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) d["a"] = Mapping({"abcG" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) d["a"] = Mapping({"abcG" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -807,7 +807,7 @@ d["a"] = FailingIter():(<class 'TypeErro d["a"] = FailingIterNext():(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using d["a"] = %s -d["a"] = None:(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +d["a"] = None:NOT FAILED d["a"] = {b"": 1}:(<class 'ValueError'>, ValueError('empty keys are not allowed',)) d["a"] = {"": 1}:(<class 'ValueError'>, ValueError('empty keys are not allowed',)) d["a"] = FailingMapping():(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -844,7 +844,7 @@ d.update({"abcF" : FailingIter()}):(<cla d.update({"abcF" : FailingIterNext()}):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using d.update({"abcF" : %s}) -d.update({"abcF" : None}):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +d.update({"abcF" : None}):NOT FAILED d.update({"abcF" : {b"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) d.update({"abcF" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) d.update({"abcF" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -871,7 +871,7 @@ d.update(Mapping({"abcG" : FailingIter() d.update(Mapping({"abcG" : FailingIterNext()})):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using d.update(Mapping({"abcG" : %s})) -d.update(Mapping({"abcG" : None})):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +d.update(Mapping({"abcG" : None})):NOT FAILED d.update(Mapping({"abcG" : {b"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) d.update(Mapping({"abcG" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) d.update(Mapping({"abcG" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -915,7 +915,7 @@ d.update((("a", {"abcF" : FailingIter()} d.update((("a", {"abcF" : FailingIterNext()}),)):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using d.update((("a", {"abcF" : %s}),)) -d.update((("a", {"abcF" : None}),)):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +d.update((("a", {"abcF" : None}),)):(<class 'vim.error'>, error("failed to add key 'a' to dictionary",)) d.update((("a", {"abcF" : {b"": 1}}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) d.update((("a", {"abcF" : {"": 1}}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) d.update((("a", {"abcF" : FailingMapping()}),)):(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -942,7 +942,7 @@ d.update((("a", Mapping({"abcG" : Failin d.update((("a", Mapping({"abcG" : FailingIterNext()})),)):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abcG" : %s})),)) -d.update((("a", Mapping({"abcG" : None})),)):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +d.update((("a", Mapping({"abcG" : None})),)):(<class 'vim.error'>, error("failed to add key 'a' to dictionary",)) d.update((("a", Mapping({"abcG" : {b"": 1}})),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) d.update((("a", Mapping({"abcG" : {"": 1}})),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) d.update((("a", Mapping({"abcG" : FailingMapping()})),)):(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -954,7 +954,7 @@ d.update((("a", FailingIter()),)):(<clas d.update((("a", FailingIterNext()),)):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using d.update((("a", %s),)) -d.update((("a", None),)):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +d.update((("a", None),)):(<class 'vim.error'>, error("failed to add key 'a' to dictionary",)) d.update((("a", {b"": 1}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) d.update((("a", {"": 1}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) d.update((("a", FailingMapping()),)):(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -993,7 +993,7 @@ vim.List([{"abcF" : FailingIter()}]):(<c vim.List([{"abcF" : FailingIterNext()}]):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using vim.List([{"abcF" : %s}]) -vim.List([{"abcF" : None}]):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +vim.List([{"abcF" : None}]):NOT FAILED vim.List([{"abcF" : {b"": 1}}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) vim.List([{"abcF" : {"": 1}}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) vim.List([{"abcF" : FailingMapping()}]):(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -1020,7 +1020,7 @@ vim.List([Mapping({"abcG" : FailingIter( vim.List([Mapping({"abcG" : FailingIterNext()})]):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using vim.List([Mapping({"abcG" : %s})]) -vim.List([Mapping({"abcG" : None})]):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +vim.List([Mapping({"abcG" : None})]):NOT FAILED vim.List([Mapping({"abcG" : {b"": 1}})]):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) vim.List([Mapping({"abcG" : {"": 1}})]):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) vim.List([Mapping({"abcG" : FailingMapping()})]):(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -1032,7 +1032,7 @@ vim.List([FailingIter()]):(<class 'TypeE vim.List([FailingIterNext()]):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using vim.List([%s]) -vim.List([None]):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +vim.List([None]):NOT FAILED vim.List([{b"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) vim.List([{"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) vim.List([FailingMapping()]):(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -1078,7 +1078,7 @@ l[:] = [{"abcF" : FailingIter()}]:(<clas l[:] = [{"abcF" : FailingIterNext()}]:(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using l[:] = [{"abcF" : %s}] -l[:] = [{"abcF" : None}]:(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +l[:] = [{"abcF" : None}]:NOT FAILED l[:] = [{"abcF" : {b"": 1}}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',)) l[:] = [{"abcF" : {"": 1}}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',)) l[:] = [{"abcF" : FailingMapping()}]:(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -1105,7 +1105,7 @@ l[:] = [Mapping({"abcG" : FailingIter()} l[:] = [Mapping({"abcG" : FailingIterNext()})]:(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abcG" : %s})] -l[:] = [Mapping({"abcG" : None})]:(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +l[:] = [Mapping({"abcG" : None})]:NOT FAILED l[:] = [Mapping({"abcG" : {b"": 1}})]:(<class 'ValueError'>, ValueError('empty keys are not allowed',)) l[:] = [Mapping({"abcG" : {"": 1}})]:(<class 'ValueError'>, ValueError('empty keys are not allowed',)) l[:] = [Mapping({"abcG" : FailingMapping()})]:(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -1117,7 +1117,7 @@ l[:] = [FailingIter()]:(<class 'TypeErro l[:] = [FailingIterNext()]:(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using l[:] = [%s] -l[:] = [None]:(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +l[:] = [None]:NOT FAILED l[:] = [{b"": 1}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',)) l[:] = [{"": 1}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',)) l[:] = [FailingMapping()]:(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -1149,7 +1149,7 @@ l.extend([{"abcF" : FailingIter()}]):(<c l.extend([{"abcF" : FailingIterNext()}]):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using l.extend([{"abcF" : %s}]) -l.extend([{"abcF" : None}]):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +l.extend([{"abcF" : None}]):NOT FAILED l.extend([{"abcF" : {b"": 1}}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) l.extend([{"abcF" : {"": 1}}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) l.extend([{"abcF" : FailingMapping()}]):(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -1176,7 +1176,7 @@ l.extend([Mapping({"abcG" : FailingIter( l.extend([Mapping({"abcG" : FailingIterNext()})]):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using l.extend([Mapping({"abcG" : %s})]) -l.extend([Mapping({"abcG" : None})]):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +l.extend([Mapping({"abcG" : None})]):NOT FAILED l.extend([Mapping({"abcG" : {b"": 1}})]):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) l.extend([Mapping({"abcG" : {"": 1}})]):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) l.extend([Mapping({"abcG" : FailingMapping()})]):(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -1188,7 +1188,7 @@ l.extend([FailingIter()]):(<class 'TypeE l.extend([FailingIterNext()]):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using l.extend([%s]) -l.extend([None]):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +l.extend([None]):NOT FAILED l.extend([{b"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) l.extend([{"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) l.extend([FailingMapping()]):(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -1236,7 +1236,7 @@ f({"abcF" : FailingIter()}):(<class 'Typ f({"abcF" : FailingIterNext()}):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using f({"abcF" : %s}) -f({"abcF" : None}):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +f({"abcF" : None}):NOT FAILED f({"abcF" : {b"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) f({"abcF" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) f({"abcF" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -1263,7 +1263,7 @@ f(Mapping({"abcG" : FailingIter()})):(<c f(Mapping({"abcG" : FailingIterNext()})):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using f(Mapping({"abcG" : %s})) -f(Mapping({"abcG" : None})):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +f(Mapping({"abcG" : None})):NOT FAILED f(Mapping({"abcG" : {b"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) f(Mapping({"abcG" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) f(Mapping({"abcG" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -1275,7 +1275,7 @@ f(FailingIter()):(<class 'TypeError'>, T f(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using f(%s) -f(None):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +f(None):NOT FAILED f({b"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) f({"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) f(FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -1302,7 +1302,7 @@ fd(self={"abcF" : FailingIter()}):(<clas fd(self={"abcF" : FailingIterNext()}):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using fd(self={"abcF" : %s}) -fd(self={"abcF" : None}):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +fd(self={"abcF" : None}):NOT FAILED fd(self={"abcF" : {b"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) fd(self={"abcF" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) fd(self={"abcF" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError('keys',)) @@ -1329,7 +1329,7 @@ fd(self=Mapping({"abcG" : FailingIter()} fd(self=Mapping({"abcG" : FailingIterNext()})):(<class 'NotImplementedError'>, NotImplementedError('next',)) <<< Finished >>> Testing ConvertFromPyObject using fd(self=Mapping({"abcG" : %s})) -fd(self=Mapping({"abcG" : None})):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',)) +fd(self=Mapping({"abcG" : None})):NOT FAILED fd(self=Mapping({"abcG" : {b"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) fd(self=Mapping({"abcG" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',)) fd(self=Mapping({"abcG" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError('keys',))