1243 |
1243 |
1244 // 3 + 4 |
1244 // 3 + 4 |
1245 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1245 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1246 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1246 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1247 QCOMPARE(spy->at(1).lineNumber, lineNumber); |
1247 QCOMPARE(spy->at(1).lineNumber, lineNumber); |
|
1248 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1248 QCOMPARE(spy->at(1).columnNumber, 8); |
1249 QCOMPARE(spy->at(1).columnNumber, 8); |
1249 |
1250 |
1250 // 5 + 6 |
1251 // 5 + 6 |
1251 QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); |
1252 QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); |
1252 QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); |
1253 QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); |
1277 |
1278 |
1278 // return 123 |
1279 // return 123 |
1279 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1280 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1280 QVERIFY(spy->at(1).scriptId != spy->at(0).scriptId); |
1281 QVERIFY(spy->at(1).scriptId != spy->at(0).scriptId); |
1281 QCOMPARE(spy->at(1).lineNumber, lineNumber); |
1282 QCOMPARE(spy->at(1).lineNumber, lineNumber); |
|
1283 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1282 QCOMPARE(spy->at(1).columnNumber, 18); |
1284 QCOMPARE(spy->at(1).columnNumber, 18); |
1283 } |
1285 } |
1284 |
1286 |
1285 { |
1287 { |
1286 spy->clear(); |
1288 spy->clear(); |
1295 |
1297 |
1296 // i = 1 |
1298 // i = 1 |
1297 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1299 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1298 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1300 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1299 QCOMPARE(spy->at(1).lineNumber, 1); |
1301 QCOMPARE(spy->at(1).lineNumber, 1); |
|
1302 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1300 QCOMPARE(spy->at(1).columnNumber, 11); |
1303 QCOMPARE(spy->at(1).columnNumber, 11); |
1301 } |
1304 } |
1302 |
1305 |
1303 { |
1306 { |
1304 spy->clear(); |
1307 spy->clear(); |
1325 |
1328 |
1326 // void(i) |
1329 // void(i) |
1327 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1330 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1328 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1331 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1329 QCOMPARE(spy->at(1).lineNumber, 1); |
1332 QCOMPARE(spy->at(1).lineNumber, 1); |
|
1333 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1330 QCOMPARE(spy->at(1).columnNumber, 31); |
1334 QCOMPARE(spy->at(1).columnNumber, 31); |
1331 |
1335 |
1332 // void(i) |
1336 // void(i) |
1333 QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); |
1337 QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); |
1334 QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); |
1338 QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); |
1335 QCOMPARE(spy->at(2).lineNumber, 1); |
1339 QCOMPARE(spy->at(2).lineNumber, 1); |
|
1340 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1336 QCOMPARE(spy->at(2).columnNumber, 31); |
1341 QCOMPARE(spy->at(2).columnNumber, 31); |
1337 } |
1342 } |
1338 |
1343 |
1339 { |
1344 { |
1340 spy->clear(); |
1345 spy->clear(); |
1349 |
1354 |
1350 // while |
1355 // while |
1351 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1356 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1352 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1357 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1353 QCOMPARE(spy->at(1).lineNumber, 1); |
1358 QCOMPARE(spy->at(1).lineNumber, 1); |
|
1359 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1354 QCOMPARE(spy->at(1).columnNumber, 12); |
1360 QCOMPARE(spy->at(1).columnNumber, 12); |
1355 |
1361 |
1356 // ++i |
1362 // ++i |
1357 QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); |
1363 QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); |
1358 QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); |
1364 QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); |
1359 QCOMPARE(spy->at(2).lineNumber, 1); |
1365 QCOMPARE(spy->at(2).lineNumber, 1); |
|
1366 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1360 QCOMPARE(spy->at(2).columnNumber, 28); |
1367 QCOMPARE(spy->at(2).columnNumber, 28); |
1361 |
1368 |
1362 // ++i |
1369 // ++i |
1363 QCOMPARE(spy->at(3).type, ScriptEngineEvent::PositionChange); |
1370 QCOMPARE(spy->at(3).type, ScriptEngineEvent::PositionChange); |
1364 QCOMPARE(spy->at(3).scriptId, spy->at(0).scriptId); |
1371 QCOMPARE(spy->at(3).scriptId, spy->at(0).scriptId); |
1365 QCOMPARE(spy->at(3).lineNumber, 1); |
1372 QCOMPARE(spy->at(3).lineNumber, 1); |
|
1373 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1366 QCOMPARE(spy->at(3).columnNumber, 28); |
1374 QCOMPARE(spy->at(3).columnNumber, 28); |
1367 } |
1375 } |
1368 |
1376 |
1369 { |
1377 { |
1370 spy->clear(); |
1378 spy->clear(); |
1379 |
1387 |
1380 // do |
1388 // do |
1381 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1389 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1382 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1390 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1383 QCOMPARE(spy->at(1).lineNumber, 1); |
1391 QCOMPARE(spy->at(1).lineNumber, 1); |
|
1392 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1384 QCOMPARE(spy->at(1).columnNumber, 12); |
1393 QCOMPARE(spy->at(1).columnNumber, 12); |
1385 |
1394 |
1386 // ++i |
1395 // ++i |
1387 QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); |
1396 QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); |
1388 QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); |
1397 QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); |
1389 QCOMPARE(spy->at(2).lineNumber, 1); |
1398 QCOMPARE(spy->at(2).lineNumber, 1); |
|
1399 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1390 QCOMPARE(spy->at(2).columnNumber, 17); |
1400 QCOMPARE(spy->at(2).columnNumber, 17); |
1391 |
1401 |
1392 // do |
1402 // do |
1393 QCOMPARE(spy->at(3).type, ScriptEngineEvent::PositionChange); |
1403 QCOMPARE(spy->at(3).type, ScriptEngineEvent::PositionChange); |
1394 QCOMPARE(spy->at(3).scriptId, spy->at(0).scriptId); |
1404 QCOMPARE(spy->at(3).scriptId, spy->at(0).scriptId); |
1395 QCOMPARE(spy->at(3).lineNumber, 1); |
1405 QCOMPARE(spy->at(3).lineNumber, 1); |
|
1406 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1396 QCOMPARE(spy->at(3).columnNumber, 12); |
1407 QCOMPARE(spy->at(3).columnNumber, 12); |
1397 |
1408 |
1398 // ++i |
1409 // ++i |
1399 QCOMPARE(spy->at(4).type, ScriptEngineEvent::PositionChange); |
1410 QCOMPARE(spy->at(4).type, ScriptEngineEvent::PositionChange); |
1400 QCOMPARE(spy->at(4).scriptId, spy->at(0).scriptId); |
1411 QCOMPARE(spy->at(4).scriptId, spy->at(0).scriptId); |
1401 QCOMPARE(spy->at(4).lineNumber, 1); |
1412 QCOMPARE(spy->at(4).lineNumber, 1); |
|
1413 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1402 QCOMPARE(spy->at(4).columnNumber, 17); |
1414 QCOMPARE(spy->at(4).columnNumber, 17); |
1403 } |
1415 } |
1404 |
1416 |
1405 { |
1417 { |
1406 spy->clear(); |
1418 spy->clear(); |
1427 |
1439 |
1428 // break |
1440 // break |
1429 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1441 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1430 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1442 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1431 QCOMPARE(spy->at(1).lineNumber, 1); |
1443 QCOMPARE(spy->at(1).lineNumber, 1); |
|
1444 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1432 QCOMPARE(spy->at(1).columnNumber, 15); |
1445 QCOMPARE(spy->at(1).columnNumber, 15); |
1433 } |
1446 } |
1434 |
1447 |
1435 { |
1448 { |
1436 spy->clear(); |
1449 spy->clear(); |
1445 |
1458 |
1446 // continue |
1459 // continue |
1447 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1460 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1448 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1461 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1449 QCOMPARE(spy->at(1).lineNumber, 1); |
1462 QCOMPARE(spy->at(1).lineNumber, 1); |
|
1463 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1450 QCOMPARE(spy->at(1).columnNumber, 32); |
1464 QCOMPARE(spy->at(1).columnNumber, 32); |
1451 |
1465 |
1452 // continue |
1466 // continue |
1453 QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); |
1467 QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); |
1454 QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); |
1468 QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); |
1455 QCOMPARE(spy->at(2).lineNumber, 1); |
1469 QCOMPARE(spy->at(2).lineNumber, 1); |
|
1470 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1456 QCOMPARE(spy->at(2).columnNumber, 32); |
1471 QCOMPARE(spy->at(2).columnNumber, 32); |
1457 } |
1472 } |
1458 |
1473 |
1459 { |
1474 { |
1460 spy->clear(); |
1475 spy->clear(); |
1493 |
1508 |
1494 // i = 5 |
1509 // i = 5 |
1495 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1510 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1496 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1511 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1497 QCOMPARE(spy->at(1).lineNumber, 1); |
1512 QCOMPARE(spy->at(1).lineNumber, 1); |
|
1513 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1498 QCOMPARE(spy->at(1).columnNumber, 31); |
1514 QCOMPARE(spy->at(1).columnNumber, 31); |
1499 } |
1515 } |
1500 |
1516 |
1501 { |
1517 { |
1502 spy->clear(); |
1518 spy->clear(); |
1511 |
1527 |
1512 // i = 5 |
1528 // i = 5 |
1513 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1529 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1514 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1530 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1515 QCOMPARE(spy->at(1).lineNumber, 1); |
1531 QCOMPARE(spy->at(1).lineNumber, 1); |
|
1532 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1516 QCOMPARE(spy->at(1).columnNumber, 38); |
1533 QCOMPARE(spy->at(1).columnNumber, 38); |
1517 |
1534 |
1518 // break |
1535 // break |
1519 QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); |
1536 QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); |
1520 QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); |
1537 QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); |
1521 QCOMPARE(spy->at(2).lineNumber, 1); |
1538 QCOMPARE(spy->at(2).lineNumber, 1); |
|
1539 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1522 QCOMPARE(spy->at(2).columnNumber, 45); |
1540 QCOMPARE(spy->at(2).columnNumber, 45); |
1523 } |
1541 } |
1524 |
1542 |
1525 { |
1543 { |
1526 spy->clear(); |
1544 spy->clear(); |
1541 |
1559 |
1542 // throw 1 |
1560 // throw 1 |
1543 QCOMPARE(spy->at(0).type, ScriptEngineEvent::PositionChange); |
1561 QCOMPARE(spy->at(0).type, ScriptEngineEvent::PositionChange); |
1544 QVERIFY(spy->at(0).scriptId != -1); |
1562 QVERIFY(spy->at(0).scriptId != -1); |
1545 QCOMPARE(spy->at(0).lineNumber, 1); |
1563 QCOMPARE(spy->at(0).lineNumber, 1); |
|
1564 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1546 QCOMPARE(spy->at(0).columnNumber, 7); |
1565 QCOMPARE(spy->at(0).columnNumber, 7); |
1547 |
1566 |
1548 // i = e |
1567 // i = e |
1549 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1568 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1550 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1569 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1551 QCOMPARE(spy->at(1).lineNumber, 1); |
1570 QCOMPARE(spy->at(1).lineNumber, 1); |
|
1571 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1552 QCOMPARE(spy->at(1).columnNumber, 29); |
1572 QCOMPARE(spy->at(1).columnNumber, 29); |
1553 |
1573 |
1554 // i = 2 |
1574 // i = 2 |
1555 QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); |
1575 QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); |
1556 QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); |
1576 QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); |
1557 QCOMPARE(spy->at(2).lineNumber, 1); |
1577 QCOMPARE(spy->at(2).lineNumber, 1); |
|
1578 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1558 QCOMPARE(spy->at(2).columnNumber, 48); |
1579 QCOMPARE(spy->at(2).columnNumber, 48); |
1559 } |
1580 } |
1560 |
1581 |
1561 { |
1582 { |
1562 spy->clear(); |
1583 spy->clear(); |
1565 |
1586 |
1566 // i = 1 |
1587 // i = 1 |
1567 QCOMPARE(spy->at(0).type, ScriptEngineEvent::PositionChange); |
1588 QCOMPARE(spy->at(0).type, ScriptEngineEvent::PositionChange); |
1568 QVERIFY(spy->at(0).scriptId != -1); |
1589 QVERIFY(spy->at(0).scriptId != -1); |
1569 QCOMPARE(spy->at(0).lineNumber, 1); |
1590 QCOMPARE(spy->at(0).lineNumber, 1); |
|
1591 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1570 QCOMPARE(spy->at(0).columnNumber, 7); |
1592 QCOMPARE(spy->at(0).columnNumber, 7); |
1571 |
1593 |
1572 // i = 3 |
1594 // i = 3 |
1573 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1595 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1574 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1596 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1575 QCOMPARE(spy->at(1).lineNumber, 1); |
1597 QCOMPARE(spy->at(1).lineNumber, 1); |
|
1598 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1576 QCOMPARE(spy->at(1).columnNumber, 46); |
1599 QCOMPARE(spy->at(1).columnNumber, 46); |
1577 } |
1600 } |
1578 |
1601 |
1579 { |
1602 { |
1580 QEXPECT_FAIL("","QTBUG-6142 I believe the test is wrong. Expressions shouldn't call positionChange " |
1603 QEXPECT_FAIL("","QTBUG-6142 I believe the test is wrong. Expressions shouldn't call positionChange " |
1592 |
1615 |
1593 // b: 20 |
1616 // b: 20 |
1594 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1617 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); |
1595 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1618 QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); |
1596 QCOMPARE(spy->at(1).lineNumber, 1); |
1619 QCOMPARE(spy->at(1).lineNumber, 1); |
|
1620 QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); |
1597 QCOMPARE(spy->at(1).columnNumber, 20); |
1621 QCOMPARE(spy->at(1).columnNumber, 20); |
1598 } |
1622 } |
1599 delete spy; |
1623 delete spy; |
1600 } |
1624 } |
1601 |
1625 |