| 1315 | array = 0 |
| 1316 | $P0 = new 'String' |
| 1317 | $P0 = "one" |
| 1318 | array.'push'($P0) |
| 1319 | $I0 = elements array |
| 1320 | $S0 = array[0] |
| 1321 | is($I0, 1, "method_push_pmc - elements") |
| 1322 | is($S0, "one", "method_push_pmc - value") |
| 1323 | |
| 1324 | $P0 = new 'String' |
| 1325 | $P0 = "two" |
| 1326 | array.'push'($P0) |
| 1327 | $I0 = elements array |
| 1328 | $S0 = array[1] |
| 1329 | is($I0, 2, "method_push_pmc (grow) - elements") |
| 1330 | is($S0, "two", "method_push_pmc (grow) - value") |
| 1331 | |
| 1332 | array = 1 |
| 1333 | array.'push'('three') |
| 1334 | $I0 = elements array |
| 1335 | $S0 = array[1] |
| 1336 | is($I0, 2, "method_push_pmc (shrink, grow) - elements") |
| 1337 | is($S0, "three", "method_push_pmc (shrink, grow) - value") |
| 1338 | .end |
| 1339 | |
| 1340 | |
| 1341 | # |
| 1342 | # test pushing STRINGs onto the array |
| 1343 | # |
| 1344 | .sub method_push_string |
| 1345 | .local pmc array |
| 1346 | array = new 'ResizableStringArray' |
| 1347 | |
| 1348 | array = 0 |
| 1349 | array.'push'("one") |
| 1350 | $I0 = elements array |
| 1351 | $S0 = array[0] |
| 1352 | is($I0, 1, "method_push_string - elements") |
| 1353 | is($S0, "one", "method_push_string - value") |
| 1354 | |
| 1355 | array.'push'("two") |
| 1356 | $I0 = elements array |
| 1357 | $S0 = array[1] |
| 1358 | is($I0, 2, "method_push_string (grow) - elements") |
| 1359 | is($S0, "two", "method_push_string (grow) - value") |
| 1360 | |
| 1361 | array = 1 |
| 1362 | array.'push'("three") |
| 1363 | $I0 = elements array |
| 1364 | $S0 = array[1] |
| 1365 | is($I0, 2, "method_push_string (shrink, grow) - elements") |
| 1366 | is($S0, "three", "method_push_string (shrink, grow) - value") |
| 1367 | .end |
| 1368 | |
| 1369 | |
| 1370 | # |
| 1371 | # test pushing INTVALs onto the array |
| 1372 | # |
| 1373 | .sub method_push_integer |
| 1374 | .local pmc array |
| 1375 | array = new 'ResizableStringArray' |
| 1376 | |
| 1377 | array = 0 |
| 1378 | array.'push'(1) |
| 1379 | $I0 = elements array |
| 1380 | $S0 = array[0] |
| 1381 | is($I0, 1, "method_push_integer - elements") |
| 1382 | is($S0, "1", "method_push_integer - value") |
| 1383 | |
| 1384 | array.'push'(2) |
| 1385 | $I0 = elements array |
| 1386 | $S0 = array[1] |
| 1387 | is($I0, 2, "method_push_integer (grow) - elements") |
| 1388 | is($S0, "2", "method_push_integer (grow) - value") |
| 1389 | |
| 1390 | array = 1 |
| 1391 | array.'push'(3) |
| 1392 | $I0 = elements array |
| 1393 | $S0 = array[1] |
| 1394 | is($I0, 2, "method_push_integer (shrink, grow) - elements") |
| 1395 | is($S0, "3", "method_push_integer (shrink, grow) - value") |
| 1396 | .end |
| 1397 | |
| 1398 | |
| 1399 | # |
| 1400 | # test pushing FLOATs onto the array |
| 1401 | # |
| 1402 | .sub method_push_float |
| 1403 | .local pmc array |
| 1404 | array = new 'ResizableStringArray' |
| 1405 | |
| 1406 | array = 0 |
| 1407 | array.'push'(1.1) |
| 1408 | $I0 = elements array |
| 1409 | $S0 = array[0] |
| 1410 | is($I0, 1, "method_push_float - elements") |
| 1411 | is($S0, "1.1", "method_push_float - value") |
| 1412 | |
| 1413 | array.'push'(2.2) |
| 1414 | $I0 = elements array |
| 1415 | $S0 = array[1] |
| 1416 | is($I0, 2, "method_push_float (grow) - elements") |
| 1417 | is($S0, "2.2", "method_push_float (grow) - value") |
| 1418 | |
| 1419 | array = 1 |
| 1420 | array.'push'(3.3) |
| 1421 | $I0 = elements array |
| 1422 | $S0 = array[1] |
| 1423 | is($I0, 2, "method_push_float (shrink, grow) - elements") |
| 1424 | is($S0, "3.3", "method_push_float (shrink, grow) - value") |
| 1425 | .end |
| 1426 | |
| 1427 | |
| 1428 | .sub method_pop_pmc |
| 1429 | .local pmc array |
| 1430 | array = new 'ResizableStringArray' |
| 1431 | |
| 1432 | array[1] = "foo" |
| 1433 | $P0 = array.'pop'() |
| 1434 | $I0 = elements array |
| 1435 | $S0 = typeof $P0 |
| 1436 | $S1 = $P0 |
| 1437 | is($I0, 1, "method_pop_pmc - elements") |
| 1438 | is($S0, 'String', "method_pop_pmc - type") |
| 1439 | is($S1, 'foo', "method_pop_pmc - value") |
| 1440 | |
| 1441 | array = 0 |
| 1442 | push_eh exception |
| 1443 | $P0 = array.'pop'() |
| 1444 | pop_eh |
| 1445 | ok(0, "method_pop_pmc - exception") |
| 1446 | .return() |
| 1447 | |
| 1448 | exception: |
| 1449 | ok(1, "method_pop_pmc - exception") |
| 1450 | .return() |
| 1451 | .end |
| 1452 | |
| 1453 | .sub method_pop_string |
| 1454 | .local pmc array |
| 1455 | array = new 'ResizableStringArray' |
| 1456 | |
| 1457 | array[1] = "foo" |
| 1458 | $S0 = array.'pop'() |
| 1459 | $I0 = elements array |
| 1460 | is($I0, 1, "method_pop_string - elements") |
| 1461 | is($S0, 'foo', "method_pop_string - value") |
| 1462 | |
| 1463 | array = 0 |
| 1464 | push_eh exception |
| 1465 | $S0 = array.'pop'() |
| 1466 | pop_eh |
| 1467 | ok(0, "method_pop_string - exception") |
| 1468 | .return() |
| 1469 | |
| 1470 | exception: |
| 1471 | ok(1, "method_pop_string - exception") |
| 1472 | .return() |
| 1473 | .end |
| 1474 | |
| 1475 | .sub method_pop_integer |
| 1476 | .local pmc array |
| 1477 | array = new 'ResizableStringArray' |
| 1478 | |
| 1479 | array[1] = "2" |
| 1480 | $I1 = array.'pop'() |
| 1481 | $I0 = elements array |
| 1482 | is($I0, 1, "method_pop_integer - elements") |
| 1483 | is($I1, 2, "method_pop_integer - value") |
| 1484 | |
| 1485 | array = 0 |
| 1486 | push_eh exception |
| 1487 | $I0 = array.'pop'() |
| 1488 | pop_eh |
| 1489 | ok(0, "method_pop_integer - exception") |
| 1490 | .return() |
| 1491 | |
| 1492 | exception: |
| 1493 | ok(1, "method_pop_integer - exception") |
| 1494 | .return() |
| 1495 | .end |
| 1496 | |
| 1497 | .sub method_pop_float |
| 1498 | .local pmc array |
| 1499 | array = new 'ResizableStringArray' |
| 1500 | |
| 1501 | array[1] = "2.2" |
| 1502 | $N0 = array.'pop'() |
| 1503 | $I0 = elements array |
| 1504 | is($I0, 1, "method_pop_float - elements") |
| 1505 | is($N0, 2.2, "method_pop_float - value") |
| 1506 | |
| 1507 | array = 0 |
| 1508 | push_eh exception |
| 1509 | $N0 = array.'pop'() |
| 1510 | pop_eh |
| 1511 | ok(0, "method_pop_float - exception") |
| 1512 | .return() |
| 1513 | |
| 1514 | exception: |
| 1515 | ok(1, "method_pop_float - exception") |
| 1516 | .return() |
| 1517 | .end |
| 1518 | |
| 1519 | .sub method_shift_pmc |
| 1520 | .local pmc array |
| 1521 | array = new 'ResizableStringArray' |
| 1522 | |
| 1523 | array[0] = "foo" |
| 1524 | array[1] = "bar" |
| 1525 | $P0 = array.'shift'() |
| 1526 | $I0 = elements array |
| 1527 | $S0 = typeof $P0 |
| 1528 | $S1 = $P0 |
| 1529 | is($I0, 1, "method_shift_pmc - elements") |
| 1530 | is($S0, 'String', "method_shift_pmc - type") |
| 1531 | is($S1, 'foo', "method_shift_pmc - value") |
| 1532 | |
| 1533 | array = 0 |
| 1534 | push_eh exception |
| 1535 | $P0 = array.'shift'() |
| 1536 | pop_eh |
| 1537 | ok(0, "method_shift_pmc - exception") |
| 1538 | .return() |
| 1539 | |
| 1540 | exception: |
| 1541 | ok(1, "method_shift_pmc - exception") |
| 1542 | .return() |
| 1543 | .end |
| 1544 | |
| 1545 | .sub method_shift_string |
| 1546 | .local pmc array |
| 1547 | array = new 'ResizableStringArray' |
| 1548 | |
| 1549 | array[0] = "foo" |
| 1550 | array[1] = "bar" |
| 1551 | $S0 = array.'shift'() |
| 1552 | $I0 = elements array |
| 1553 | is($I0, 1, "method_shift_string - elements") |
| 1554 | is($S0, 'foo', "method_shift_string - value") |
| 1555 | |
| 1556 | array = 0 |
| 1557 | push_eh exception |
| 1558 | $S0 = array.'shift'() |
| 1559 | pop_eh |
| 1560 | ok(0, "method_shift_string - exception") |
| 1561 | .return() |
| 1562 | |
| 1563 | exception: |
| 1564 | ok(1, "method_shift_string - exception") |
| 1565 | .return() |
| 1566 | .end |
| 1567 | |
| 1568 | .sub method_shift_integer |
| 1569 | .local pmc array |
| 1570 | array = new 'ResizableStringArray' |
| 1571 | |
| 1572 | array[0] = "2" |
| 1573 | array[1] = "3" |
| 1574 | $I1 = array.'shift'() |
| 1575 | $I0 = elements array |
| 1576 | is($I0, 1, "method_shift_integer - elements") |
| 1577 | is($I1, 2, "method_shift_integer - value") |
| 1578 | |
| 1579 | array = 0 |
| 1580 | push_eh exception |
| 1581 | $I0 = array.'shift'() |
| 1582 | pop_eh |
| 1583 | ok(0, "method_shift_integer - exception") |
| 1584 | .return() |
| 1585 | |
| 1586 | exception: |
| 1587 | ok(1, "method_shift_integer - exception") |
| 1588 | .return() |
| 1589 | .end |
| 1590 | |
| 1591 | .sub method_shift_float |
| 1592 | .local pmc array |
| 1593 | array = new 'ResizableStringArray' |
| 1594 | |
| 1595 | array[0] = "2.2" |
| 1596 | array[1] = "3.3" |
| 1597 | $N0 = array.'shift'() |
| 1598 | $I0 = elements array |
| 1599 | is($I0, 1, "method_shift_float - elements") |
| 1600 | is($N0, 2.2, "method_shift_float - value") |
| 1601 | |
| 1602 | array = 0 |
| 1603 | push_eh exception |
| 1604 | $N0 = array.'shift'() |
| 1605 | pop_eh |
| 1606 | ok(0, "method_shift_float - exception") |
| 1607 | .return() |
| 1608 | |
| 1609 | exception: |
| 1610 | ok(1, "method_shift_float - exception") |
| 1611 | .return() |
| 1612 | .end |
| 1613 | |
| 1614 | .sub method_unshift_pmc |
| 1615 | .local pmc array |
| 1616 | array = new 'ResizableStringArray' |
| 1617 | |
| 1618 | array = 0 |
| 1619 | $P0 = new 'String' |
| 1620 | $P0 = "one" |
| 1621 | array.'unshift'($P0) |
| 1622 | $I0 = elements array |
| 1623 | $S0 = array[0] |
| 1624 | is($I0, 1, "method_unshift_pmc - elements") |
| 1625 | is($S0, "one", "method_unshift_pmc - value") |
| 1626 | |
| 1627 | $P0 = new 'String' |
| 1628 | $P0 = "two" |
| 1629 | array.'unshift'($P0) |
| 1630 | $I0 = elements array |
| 1631 | $S0 = array[0] |
| 1632 | is($I0, 2, "method_unshift_pmc (grow) - elements") |
| 1633 | is($S0, "two", "method_unshift_pmc (grow) - value") |
| 1634 | |
| 1635 | array = 1 |
| 1636 | array.'unshift'("three") |
| 1637 | $I0 = elements array |
| 1638 | $S0 = array[0] |
| 1639 | is($I0, 2, "method_unshift_pmc (shrink, grow) - elements") |
| 1640 | is($S0, "three", "method_unshift_pmc (shrink, grow) - value") |
| 1641 | .end |
| 1642 | |
| 1643 | |
| 1644 | # |
| 1645 | # test unshifting STRINGs onto the array |
| 1646 | # |
| 1647 | .sub method_unshift_string |
| 1648 | .local pmc array |
| 1649 | array = new 'ResizableStringArray' |
| 1650 | |
| 1651 | array = 0 |
| 1652 | array.'unshift'("one") |
| 1653 | $I0 = elements array |
| 1654 | $S0 = array[0] |
| 1655 | is($I0, 1, "method_unshift_string - elements") |
| 1656 | is($S0, "one", "method_unshift_string - value") |
| 1657 | |
| 1658 | array.'unshift'("two") |
| 1659 | $I0 = elements array |
| 1660 | $S0 = array[0] |
| 1661 | is($I0, 2, "method_unshift_string (grow) - elements") |
| 1662 | is($S0, "two", "method_unshift_string (grow) - value") |
| 1663 | |
| 1664 | array = 1 |
| 1665 | array.'unshift'("three") |
| 1666 | $I0 = elements array |
| 1667 | $S0 = array[0] |
| 1668 | is($I0, 2, "method_unshift_string (shrink, grow) - elements") |
| 1669 | is($S0, "three", "method_unshift_string (shrink, grow) - value") |
| 1670 | .end |
| 1671 | |
| 1672 | |
| 1673 | # |
| 1674 | # test unshifting INTVALs onto the array |
| 1675 | # |
| 1676 | .sub method_unshift_integer |
| 1677 | .local pmc array |
| 1678 | array = new 'ResizableStringArray' |
| 1679 | |
| 1680 | array = 0 |
| 1681 | array.'unshift'(1) |
| 1682 | $I0 = elements array |
| 1683 | $S0 = array[0] |
| 1684 | is($I0, 1, "method_unshift_integer - elements") |
| 1685 | is($S0, "1", "method_unshift_integer - value") |
| 1686 | |
| 1687 | array.'unshift'(2) |
| 1688 | $I0 = elements array |
| 1689 | $S0 = array[0] |
| 1690 | is($I0, 2, "method_unshift_integer (grow) - elements") |
| 1691 | is($S0, "2", "method_unshift_integer (grow) - value") |
| 1692 | |
| 1693 | array = 1 |
| 1694 | array.'unshift'(3) |
| 1695 | $I0 = elements array |
| 1696 | $S0 = array[0] |
| 1697 | is($I0, 2, "method_unshift_integer (shrink, grow) - elements") |
| 1698 | is($S0, "3", "method_unshift_integer (shrink, grow) - value") |
| 1699 | .end |
| 1700 | |
| 1701 | |
| 1702 | # |
| 1703 | # test unshifting FLOATs onto the array |
| 1704 | # |
| 1705 | .sub method_unshift_float |
| 1706 | .local pmc array |
| 1707 | array = new 'ResizableStringArray' |
| 1708 | |
| 1709 | array = 0 |
| 1710 | array.'unshift'(1.1) |
| 1711 | $I0 = elements array |
| 1712 | $S0 = array[0] |
| 1713 | is($I0, 1, "method_unshift_float - elements") |
| 1714 | is($S0, "1.1", "method_unshift_float - value") |
| 1715 | |
| 1716 | array.'unshift'(2.2) |
| 1717 | $I0 = elements array |
| 1718 | $S0 = array[0] |
| 1719 | is($I0, 2, "method_unshift_float (grow) - elements") |
| 1720 | is($S0, "2.2", "method_unshift_float (grow) - value") |
| 1721 | |
| 1722 | array = 1 |
| 1723 | array.'unshift'(3.3) |
| 1724 | $I0 = elements array |
| 1725 | $S0 = array[0] |
| 1726 | is($I0, 2, "method_unshift_float (shrink, grow) - elements") |
| 1727 | is($S0, "3.3", "method_unshift_float (shrink, grow) - value") |
| 1728 | .end |
| 1729 | |