Changeset View
Changeset View
Standalone View
Standalone View
duchain/tests/pyduchaintest.cpp
Context not available. | |||||
1393 | "class Foo:\n def __getitem__(self, key):\n return str()\n" | 1393 | "class Foo:\n def __getitem__(self, key):\n return str()\n" | ||
---|---|---|---|---|---|
1394 | "def bar():\n return Foo()\n" | 1394 | "def bar():\n return Foo()\n" | ||
1395 | "checkme = bar()[0]" << "str" << true; | 1395 | "checkme = bar()[0]" << "str" << true; | ||
1396 | QTest::newRow("subscript_unknown_index") << "a = 1,str()\ncheckme = a[5-4]" << "unsure (int, str)" << true; | ||||
1397 | QTest::newRow("subscript_unsure") << "a = 1,2\na=[str()]\ncheckme = a[0]" << "unsure (int, str)" << true; | ||||
1398 | QTest::newRow("subscript_unsure_getitem") << | ||||
1399 | "class Foo:\n def __getitem__(self, key):\n return str()\n" | ||||
1400 | "class Bar:\n def __getitem__(self, key):\n return float()\n" | ||||
1401 | "a = Foo()\na=Bar()\na=[1,2]\ncheckme = a[1]" << "unsure (str, float, int)" << true; | ||||
1396 | } | 1402 | } | ||
1397 | 1403 | | |||
1398 | void PyDUChainTest::testVariableCreation() | 1404 | void PyDUChainTest::testVariableCreation() | ||
Context not available. |