Changeset View
Changeset View
Standalone View
Standalone View
duchain/tests/pyduchaintest.cpp
Show First 20 Lines • Show All 1470 Lines • ▼ Show 20 Line(s) | |||||
1471 | 1471 | | |||
1472 | void PyDUChainTest::testContainerTypes_data() | 1472 | void PyDUChainTest::testContainerTypes_data() | ||
1473 | { | 1473 | { | ||
1474 | QTest::addColumn<QString>("code"); | 1474 | QTest::addColumn<QString>("code"); | ||
1475 | QTest::addColumn<QString>("contenttype"); | 1475 | QTest::addColumn<QString>("contenttype"); | ||
1476 | QTest::addColumn<bool>("use_type"); | 1476 | QTest::addColumn<bool>("use_type"); | ||
1477 | 1477 | | |||
1478 | QTest::newRow("list_of_int") << "checkme = [1, 2, 3]" << "int" << false; | 1478 | QTest::newRow("list_of_int") << "checkme = [1, 2, 3]" << "int" << false; | ||
1479 | QTest::newRow("list_from_unpacked") << "foo = [1.3]\ncheckme = [1, *foo, 3]" << "unsure (int, float)" << false; | ||||
1479 | QTest::newRow("list_of_int_call") << "checkme = list([1, 2, 3])" << "int" << false; | 1480 | QTest::newRow("list_of_int_call") << "checkme = list([1, 2, 3])" << "int" << false; | ||
1480 | QTest::newRow("generator") << "checkme = [i for i in [1, 2, 3]]" << "int" << false; | 1481 | QTest::newRow("generator") << "checkme = [i for i in [1, 2, 3]]" << "int" << false; | ||
1481 | QTest::newRow("list_access") << "list = [1, 2, 3]\ncheckme = list[0]" << "int" << true; | 1482 | QTest::newRow("list_access") << "list = [1, 2, 3]\ncheckme = list[0]" << "int" << true; | ||
1482 | QTest::newRow("set_of_int") << "checkme = {1, 2, 3}" << "int" << false; | 1483 | QTest::newRow("set_of_int") << "checkme = {1, 2, 3}" << "int" << false; | ||
1484 | QTest::newRow("set_from_unpacked") << "foo = [1.3]\ncheckme = {1, *foo, 3}" << "unsure (int, float)" << false; | ||||
1483 | QTest::newRow("set_of_int_call") << "checkme = set({1, 2, 3})" << "int" << false; | 1485 | QTest::newRow("set_of_int_call") << "checkme = set({1, 2, 3})" << "int" << false; | ||
1484 | QTest::newRow("set_generator") << "checkme = {i for i in [1, 2, 3]}" << "int" << false; | 1486 | QTest::newRow("set_generator") << "checkme = {i for i in [1, 2, 3]}" << "int" << false; | ||
1485 | QTest::newRow("dict_of_int") << "checkme = {a:1, b:2, c:3}" << "int" << false; | 1487 | QTest::newRow("dict_of_int") << "checkme = {a:1, b:2, c:3}" << "int" << false; | ||
1486 | QTest::newRow("dict_from_unpacked") << "checkme = {**{'a': 1}}" << "dict of str : int" << true; | 1488 | QTest::newRow("dict_from_unpacked") << "checkme = {**{'a': 1}}" << "dict of str : int" << true; | ||
1487 | QTest::newRow("dict_from_varied") << "checkme = {**{'a': 1}, 1: 1.5}" << | 1489 | QTest::newRow("dict_from_varied") << "checkme = {**{'a': 1}, 1: 1.5}" << | ||
1488 | "dict of unsure (str, int) : unsure (int, float)" << true; | 1490 | "dict of unsure (str, int) : unsure (int, float)" << true; | ||
1489 | QTest::newRow("dict_of_int_call") << "checkme = dict({a:1, b:2, c:3})" << "int" << false; | 1491 | QTest::newRow("dict_of_int_call") << "checkme = dict({a:1, b:2, c:3})" << "int" << false; | ||
1490 | QTest::newRow("dict_generator") << "checkme = {\"Foo\":i for i in [1, 2, 3]}" << "int" << false; | 1492 | QTest::newRow("dict_generator") << "checkme = {\"Foo\":i for i in [1, 2, 3]}" << "int" << false; | ||
▲ Show 20 Lines • Show All 134 Lines • Show Last 20 Lines |