/perl-5.16.0/t/op/loopctl.t

# · Perl · 1008 lines · 836 code · 134 blank · 38 comment · 77 complexity · 4d09a0e3481024e84ba17a406157eb37 MD5 · raw file

  1. #!./perl
  2. # We have the following types of loop:
  3. #
  4. # 1a) while(A) {B}
  5. # 1b) B while A;
  6. #
  7. # 2a) until(A) {B}
  8. # 2b) B until A;
  9. #
  10. # 3a) for(@A) {B}
  11. # 3b) B for A;
  12. #
  13. # 4a) for (A;B;C) {D}
  14. #
  15. # 5a) { A } # a bare block is a loop which runs once
  16. #
  17. # Loops of type (b) don't allow for next/last/redo style
  18. # control, so we ignore them here. Type (a) loops can
  19. # all be labelled, so there are ten possibilities (each
  20. # of 5 types, labelled/unlabelled). We therefore need
  21. # thirty tests to try the three control statements against
  22. # the ten types of loop. For the first four types it's useful
  23. # to distinguish the case where next re-iterates from the case
  24. # where it leaves the loop. That makes 38.
  25. # All these tests rely on "last LABEL"
  26. # so if they've *all* failed, maybe you broke that...
  27. #
  28. # These tests are followed by an extra test of nested loops.
  29. # Feel free to add more here.
  30. #
  31. # -- .robin. <robin@kitsite.com> 2001-03-13
  32. BEGIN {
  33. chdir 't' if -d 't';
  34. @INC = qw(. ../lib);
  35. }
  36. require "test.pl";
  37. plan( tests => 55 );
  38. my $ok;
  39. TEST1: {
  40. $ok = 0;
  41. my $x = 1;
  42. my $first_time = 1;
  43. while($x--) {
  44. if (!$first_time) {
  45. $ok = 1;
  46. last TEST1;
  47. }
  48. $ok = 0;
  49. $first_time = 0;
  50. redo;
  51. last TEST1;
  52. }
  53. continue {
  54. $ok = 0;
  55. last TEST1;
  56. }
  57. $ok = 0;
  58. }
  59. cmp_ok($ok,'==',1,'no label on while()');
  60. TEST2: {
  61. $ok = 0;
  62. my $x = 2;
  63. my $first_time = 1;
  64. my $been_in_continue = 0;
  65. while($x--) {
  66. if (!$first_time) {
  67. $ok = $been_in_continue;
  68. last TEST2;
  69. }
  70. $ok = 0;
  71. $first_time = 0;
  72. next;
  73. last TEST2;
  74. }
  75. continue {
  76. $been_in_continue = 1;
  77. }
  78. $ok = 0;
  79. }
  80. cmp_ok($ok,'==',1,'no label on while() successful next');
  81. TEST3: {
  82. $ok = 0;
  83. my $x = 1;
  84. my $first_time = 1;
  85. my $been_in_loop = 0;
  86. my $been_in_continue = 0;
  87. while($x--) {
  88. $been_in_loop = 1;
  89. if (!$first_time) {
  90. $ok = 0;
  91. last TEST3;
  92. }
  93. $ok = 0;
  94. $first_time = 0;
  95. next;
  96. last TEST3;
  97. }
  98. continue {
  99. $been_in_continue = 1;
  100. }
  101. $ok = $been_in_loop && $been_in_continue;
  102. }
  103. cmp_ok($ok,'==',1,'no label on while() unsuccessful next');
  104. TEST4: {
  105. $ok = 0;
  106. my $x = 1;
  107. my $first_time = 1;
  108. while($x++) {
  109. if (!$first_time) {
  110. $ok = 0;
  111. last TEST4;
  112. }
  113. $ok = 0;
  114. $first_time = 0;
  115. last;
  116. last TEST4;
  117. }
  118. continue {
  119. $ok = 0;
  120. last TEST4;
  121. }
  122. $ok = 1;
  123. }
  124. cmp_ok($ok,'==',1,'no label on while() last');
  125. TEST5: {
  126. $ok = 0;
  127. my $x = 0;
  128. my $first_time = 1;
  129. until($x++) {
  130. if (!$first_time) {
  131. $ok = 1;
  132. last TEST5;
  133. }
  134. $ok = 0;
  135. $first_time = 0;
  136. redo;
  137. last TEST5;
  138. }
  139. continue {
  140. $ok = 0;
  141. last TEST5;
  142. }
  143. $ok = 0;
  144. }
  145. cmp_ok($ok,'==',1,'no label on until()');
  146. TEST6: {
  147. $ok = 0;
  148. my $x = 0;
  149. my $first_time = 1;
  150. my $been_in_continue = 0;
  151. until($x++ >= 2) {
  152. if (!$first_time) {
  153. $ok = $been_in_continue;
  154. last TEST6;
  155. }
  156. $ok = 0;
  157. $first_time = 0;
  158. next;
  159. last TEST6;
  160. }
  161. continue {
  162. $been_in_continue = 1;
  163. }
  164. $ok = 0;
  165. }
  166. cmp_ok($ok,'==',1,'no label on until() successful next');
  167. TEST7: {
  168. $ok = 0;
  169. my $x = 0;
  170. my $first_time = 1;
  171. my $been_in_loop = 0;
  172. my $been_in_continue = 0;
  173. until($x++) {
  174. $been_in_loop = 1;
  175. if (!$first_time) {
  176. $ok = 0;
  177. last TEST7;
  178. }
  179. $ok = 0;
  180. $first_time = 0;
  181. next;
  182. last TEST7;
  183. }
  184. continue {
  185. $been_in_continue = 1;
  186. }
  187. $ok = $been_in_loop && $been_in_continue;
  188. }
  189. cmp_ok($ok,'==',1,'no label on until() unsuccessful next');
  190. TEST8: {
  191. $ok = 0;
  192. my $x = 0;
  193. my $first_time = 1;
  194. until($x++ == 10) {
  195. if (!$first_time) {
  196. $ok = 0;
  197. last TEST8;
  198. }
  199. $ok = 0;
  200. $first_time = 0;
  201. last;
  202. last TEST8;
  203. }
  204. continue {
  205. $ok = 0;
  206. last TEST8;
  207. }
  208. $ok = 1;
  209. }
  210. cmp_ok($ok,'==',1,'no label on until() last');
  211. TEST9: {
  212. $ok = 0;
  213. my $first_time = 1;
  214. for(1) {
  215. if (!$first_time) {
  216. $ok = 1;
  217. last TEST9;
  218. }
  219. $ok = 0;
  220. $first_time = 0;
  221. redo;
  222. last TEST9;
  223. }
  224. continue {
  225. $ok = 0;
  226. last TEST9;
  227. }
  228. $ok = 0;
  229. }
  230. cmp_ok($ok,'==',1,'no label on for(@array)');
  231. TEST10: {
  232. $ok = 0;
  233. my $first_time = 1;
  234. my $been_in_continue = 0;
  235. for(1,2) {
  236. if (!$first_time) {
  237. $ok = $been_in_continue;
  238. last TEST10;
  239. }
  240. $ok = 0;
  241. $first_time = 0;
  242. next;
  243. last TEST10;
  244. }
  245. continue {
  246. $been_in_continue = 1;
  247. }
  248. $ok = 0;
  249. }
  250. cmp_ok($ok,'==',1,'no label on for(@array) successful next');
  251. TEST11: {
  252. $ok = 0;
  253. my $first_time = 1;
  254. my $been_in_loop = 0;
  255. my $been_in_continue = 0;
  256. for(1) {
  257. $been_in_loop = 1;
  258. if (!$first_time) {
  259. $ok = 0;
  260. last TEST11;
  261. }
  262. $ok = 0;
  263. $first_time = 0;
  264. next;
  265. last TEST11;
  266. }
  267. continue {
  268. $been_in_continue = 1;
  269. }
  270. $ok = $been_in_loop && $been_in_continue;
  271. }
  272. cmp_ok($ok,'==',1,'no label on for(@array) unsuccessful next');
  273. TEST12: {
  274. $ok = 0;
  275. my $first_time = 1;
  276. for(1..10) {
  277. if (!$first_time) {
  278. $ok = 0;
  279. last TEST12;
  280. }
  281. $ok = 0;
  282. $first_time = 0;
  283. last;
  284. last TEST12;
  285. }
  286. continue {
  287. $ok=0;
  288. last TEST12;
  289. }
  290. $ok = 1;
  291. }
  292. cmp_ok($ok,'==',1,'no label on for(@array) last');
  293. TEST13: {
  294. $ok = 0;
  295. for(my $first_time = 1; 1;) {
  296. if (!$first_time) {
  297. $ok = 1;
  298. last TEST13;
  299. }
  300. $ok = 0;
  301. $first_time=0;
  302. redo;
  303. last TEST13;
  304. }
  305. $ok = 0;
  306. }
  307. cmp_ok($ok,'==',1,'no label on for(;;)');
  308. TEST14: {
  309. $ok = 0;
  310. for(my $first_time = 1; 1; $first_time=0) {
  311. if (!$first_time) {
  312. $ok = 1;
  313. last TEST14;
  314. }
  315. $ok = 0;
  316. next;
  317. last TEST14;
  318. }
  319. $ok = 0;
  320. }
  321. cmp_ok($ok,'==',1,'no label on for(;;) successful next');
  322. TEST15: {
  323. $ok = 0;
  324. my $x=1;
  325. my $been_in_loop = 0;
  326. for(my $first_time = 1; $x--;) {
  327. $been_in_loop = 1;
  328. if (!$first_time) {
  329. $ok = 0;
  330. last TEST15;
  331. }
  332. $ok = 0;
  333. $first_time = 0;
  334. next;
  335. last TEST15;
  336. }
  337. $ok = $been_in_loop;
  338. }
  339. cmp_ok($ok,'==',1,'no label on for(;;) unsuccessful next');
  340. TEST16: {
  341. $ok = 0;
  342. for(my $first_time = 1; 1; last TEST16) {
  343. if (!$first_time) {
  344. $ok = 0;
  345. last TEST16;
  346. }
  347. $ok = 0;
  348. $first_time = 0;
  349. last;
  350. last TEST16;
  351. }
  352. $ok = 1;
  353. }
  354. cmp_ok($ok,'==',1,'no label on for(;;) last');
  355. TEST17: {
  356. $ok = 0;
  357. my $first_time = 1;
  358. {
  359. if (!$first_time) {
  360. $ok = 1;
  361. last TEST17;
  362. }
  363. $ok = 0;
  364. $first_time=0;
  365. redo;
  366. last TEST17;
  367. }
  368. continue {
  369. $ok = 0;
  370. last TEST17;
  371. }
  372. $ok = 0;
  373. }
  374. cmp_ok($ok,'==',1,'no label on bare block');
  375. TEST18: {
  376. $ok = 0;
  377. {
  378. next;
  379. last TEST18;
  380. }
  381. continue {
  382. $ok = 1;
  383. last TEST18;
  384. }
  385. $ok = 0;
  386. }
  387. cmp_ok($ok,'==',1,'no label on bare block next');
  388. TEST19: {
  389. $ok = 0;
  390. {
  391. last;
  392. last TEST19;
  393. }
  394. continue {
  395. $ok = 0;
  396. last TEST19;
  397. }
  398. $ok = 1;
  399. }
  400. cmp_ok($ok,'==',1,'no label on bare block last');
  401. ### Now do it all again with labels
  402. TEST20: {
  403. $ok = 0;
  404. my $x = 1;
  405. my $first_time = 1;
  406. LABEL20: while($x--) {
  407. if (!$first_time) {
  408. $ok = 1;
  409. last TEST20;
  410. }
  411. $ok = 0;
  412. $first_time = 0;
  413. redo LABEL20;
  414. last TEST20;
  415. }
  416. continue {
  417. $ok = 0;
  418. last TEST20;
  419. }
  420. $ok = 0;
  421. }
  422. cmp_ok($ok,'==',1,'label on while()');
  423. TEST21: {
  424. $ok = 0;
  425. my $x = 2;
  426. my $first_time = 1;
  427. my $been_in_continue = 0;
  428. LABEL21: while($x--) {
  429. if (!$first_time) {
  430. $ok = $been_in_continue;
  431. last TEST21;
  432. }
  433. $ok = 0;
  434. $first_time = 0;
  435. next LABEL21;
  436. last TEST21;
  437. }
  438. continue {
  439. $been_in_continue = 1;
  440. }
  441. $ok = 0;
  442. }
  443. cmp_ok($ok,'==',1,'label on while() successful next');
  444. TEST22: {
  445. $ok = 0;
  446. my $x = 1;
  447. my $first_time = 1;
  448. my $been_in_loop = 0;
  449. my $been_in_continue = 0;
  450. LABEL22: while($x--) {
  451. $been_in_loop = 1;
  452. if (!$first_time) {
  453. $ok = 0;
  454. last TEST22;
  455. }
  456. $ok = 0;
  457. $first_time = 0;
  458. next LABEL22;
  459. last TEST22;
  460. }
  461. continue {
  462. $been_in_continue = 1;
  463. }
  464. $ok = $been_in_loop && $been_in_continue;
  465. }
  466. cmp_ok($ok,'==',1,'label on while() unsuccessful next');
  467. TEST23: {
  468. $ok = 0;
  469. my $x = 1;
  470. my $first_time = 1;
  471. LABEL23: while($x++) {
  472. if (!$first_time) {
  473. $ok = 0;
  474. last TEST23;
  475. }
  476. $ok = 0;
  477. $first_time = 0;
  478. last LABEL23;
  479. last TEST23;
  480. }
  481. continue {
  482. $ok = 0;
  483. last TEST23;
  484. }
  485. $ok = 1;
  486. }
  487. cmp_ok($ok,'==',1,'label on while() last');
  488. TEST24: {
  489. $ok = 0;
  490. my $x = 0;
  491. my $first_time = 1;
  492. LABEL24: until($x++) {
  493. if (!$first_time) {
  494. $ok = 1;
  495. last TEST24;
  496. }
  497. $ok = 0;
  498. $first_time = 0;
  499. redo LABEL24;
  500. last TEST24;
  501. }
  502. continue {
  503. $ok = 0;
  504. last TEST24;
  505. }
  506. $ok = 0;
  507. }
  508. cmp_ok($ok,'==',1,'label on until()');
  509. TEST25: {
  510. $ok = 0;
  511. my $x = 0;
  512. my $first_time = 1;
  513. my $been_in_continue = 0;
  514. LABEL25: until($x++ >= 2) {
  515. if (!$first_time) {
  516. $ok = $been_in_continue;
  517. last TEST25;
  518. }
  519. $ok = 0;
  520. $first_time = 0;
  521. next LABEL25;
  522. last TEST25;
  523. }
  524. continue {
  525. $been_in_continue = 1;
  526. }
  527. $ok = 0;
  528. }
  529. cmp_ok($ok,'==',1,'label on until() successful next');
  530. TEST26: {
  531. $ok = 0;
  532. my $x = 0;
  533. my $first_time = 1;
  534. my $been_in_loop = 0;
  535. my $been_in_continue = 0;
  536. LABEL26: until($x++) {
  537. $been_in_loop = 1;
  538. if (!$first_time) {
  539. $ok = 0;
  540. last TEST26;
  541. }
  542. $ok = 0;
  543. $first_time = 0;
  544. next LABEL26;
  545. last TEST26;
  546. }
  547. continue {
  548. $been_in_continue = 1;
  549. }
  550. $ok = $been_in_loop && $been_in_continue;
  551. }
  552. cmp_ok($ok,'==',1,'label on until() unsuccessful next');
  553. TEST27: {
  554. $ok = 0;
  555. my $x = 0;
  556. my $first_time = 1;
  557. LABEL27: until($x++ == 10) {
  558. if (!$first_time) {
  559. $ok = 0;
  560. last TEST27;
  561. }
  562. $ok = 0;
  563. $first_time = 0;
  564. last LABEL27;
  565. last TEST27;
  566. }
  567. continue {
  568. $ok = 0;
  569. last TEST8;
  570. }
  571. $ok = 1;
  572. }
  573. cmp_ok($ok,'==',1,'label on until() last');
  574. TEST28: {
  575. $ok = 0;
  576. my $first_time = 1;
  577. LABEL28: for(1) {
  578. if (!$first_time) {
  579. $ok = 1;
  580. last TEST28;
  581. }
  582. $ok = 0;
  583. $first_time = 0;
  584. redo LABEL28;
  585. last TEST28;
  586. }
  587. continue {
  588. $ok = 0;
  589. last TEST28;
  590. }
  591. $ok = 0;
  592. }
  593. cmp_ok($ok,'==',1,'label on for(@array)');
  594. TEST29: {
  595. $ok = 0;
  596. my $first_time = 1;
  597. my $been_in_continue = 0;
  598. LABEL29: for(1,2) {
  599. if (!$first_time) {
  600. $ok = $been_in_continue;
  601. last TEST29;
  602. }
  603. $ok = 0;
  604. $first_time = 0;
  605. next LABEL29;
  606. last TEST29;
  607. }
  608. continue {
  609. $been_in_continue = 1;
  610. }
  611. $ok = 0;
  612. }
  613. cmp_ok($ok,'==',1,'label on for(@array) successful next');
  614. TEST30: {
  615. $ok = 0;
  616. my $first_time = 1;
  617. my $been_in_loop = 0;
  618. my $been_in_continue = 0;
  619. LABEL30: for(1) {
  620. $been_in_loop = 1;
  621. if (!$first_time) {
  622. $ok = 0;
  623. last TEST30;
  624. }
  625. $ok = 0;
  626. $first_time = 0;
  627. next LABEL30;
  628. last TEST30;
  629. }
  630. continue {
  631. $been_in_continue = 1;
  632. }
  633. $ok = $been_in_loop && $been_in_continue;
  634. }
  635. cmp_ok($ok,'==',1,'label on for(@array) unsuccessful next');
  636. TEST31: {
  637. $ok = 0;
  638. my $first_time = 1;
  639. LABEL31: for(1..10) {
  640. if (!$first_time) {
  641. $ok = 0;
  642. last TEST31;
  643. }
  644. $ok = 0;
  645. $first_time = 0;
  646. last LABEL31;
  647. last TEST31;
  648. }
  649. continue {
  650. $ok=0;
  651. last TEST31;
  652. }
  653. $ok = 1;
  654. }
  655. cmp_ok($ok,'==',1,'label on for(@array) last');
  656. TEST32: {
  657. $ok = 0;
  658. LABEL32: for(my $first_time = 1; 1;) {
  659. if (!$first_time) {
  660. $ok = 1;
  661. last TEST32;
  662. }
  663. $ok = 0;
  664. $first_time=0;
  665. redo LABEL32;
  666. last TEST32;
  667. }
  668. $ok = 0;
  669. }
  670. cmp_ok($ok,'==',1,'label on for(;;)');
  671. TEST33: {
  672. $ok = 0;
  673. LABEL33: for(my $first_time = 1; 1; $first_time=0) {
  674. if (!$first_time) {
  675. $ok = 1;
  676. last TEST33;
  677. }
  678. $ok = 0;
  679. next LABEL33;
  680. last TEST33;
  681. }
  682. $ok = 0;
  683. }
  684. cmp_ok($ok,'==',1,'label on for(;;) successful next');
  685. TEST34: {
  686. $ok = 0;
  687. my $x=1;
  688. my $been_in_loop = 0;
  689. LABEL34: for(my $first_time = 1; $x--;) {
  690. $been_in_loop = 1;
  691. if (!$first_time) {
  692. $ok = 0;
  693. last TEST34;
  694. }
  695. $ok = 0;
  696. $first_time = 0;
  697. next LABEL34;
  698. last TEST34;
  699. }
  700. $ok = $been_in_loop;
  701. }
  702. cmp_ok($ok,'==',1,'label on for(;;) unsuccessful next');
  703. TEST35: {
  704. $ok = 0;
  705. LABEL35: for(my $first_time = 1; 1; last TEST16) {
  706. if (!$first_time) {
  707. $ok = 0;
  708. last TEST35;
  709. }
  710. $ok = 0;
  711. $first_time = 0;
  712. last LABEL35;
  713. last TEST35;
  714. }
  715. $ok = 1;
  716. }
  717. cmp_ok($ok,'==',1,'label on for(;;) last');
  718. TEST36: {
  719. $ok = 0;
  720. my $first_time = 1;
  721. LABEL36: {
  722. if (!$first_time) {
  723. $ok = 1;
  724. last TEST36;
  725. }
  726. $ok = 0;
  727. $first_time=0;
  728. redo LABEL36;
  729. last TEST36;
  730. }
  731. continue {
  732. $ok = 0;
  733. last TEST36;
  734. }
  735. $ok = 0;
  736. }
  737. cmp_ok($ok,'==',1,'label on bare block');
  738. TEST37: {
  739. $ok = 0;
  740. LABEL37: {
  741. next LABEL37;
  742. last TEST37;
  743. }
  744. continue {
  745. $ok = 1;
  746. last TEST37;
  747. }
  748. $ok = 0;
  749. }
  750. cmp_ok($ok,'==',1,'label on bare block next');
  751. TEST38: {
  752. $ok = 0;
  753. LABEL38: {
  754. last LABEL38;
  755. last TEST38;
  756. }
  757. continue {
  758. $ok = 0;
  759. last TEST38;
  760. }
  761. $ok = 1;
  762. }
  763. cmp_ok($ok,'==',1,'label on bare block last');
  764. TEST39: {
  765. $ok = 0;
  766. my ($x, $y, $z) = (1,1,1);
  767. one39: while ($x--) {
  768. $ok = 0;
  769. two39: while ($y--) {
  770. $ok = 0;
  771. three39: while ($z--) {
  772. next two39;
  773. }
  774. continue {
  775. $ok = 0;
  776. last TEST39;
  777. }
  778. }
  779. continue {
  780. $ok = 1;
  781. last TEST39;
  782. }
  783. $ok = 0;
  784. }
  785. }
  786. cmp_ok($ok,'==',1,'nested constructs');
  787. sub test_last_label { last TEST40 }
  788. TEST40: {
  789. $ok = 1;
  790. test_last_label();
  791. $ok = 0;
  792. }
  793. cmp_ok($ok,'==',1,'dynamically scoped label');
  794. sub test_last { last }
  795. TEST41: {
  796. $ok = 1;
  797. test_last();
  798. $ok = 0;
  799. }
  800. cmp_ok($ok,'==',1,'dynamically scoped');
  801. # [perl #27206] Memory leak in continue loop
  802. # Ensure that the temporary object is freed each time round the loop,
  803. # rather then all 10 of them all being freed right at the end
  804. {
  805. my $n=10; my $late_free = 0;
  806. sub X::DESTROY { $late_free++ if $n < 0 };
  807. {
  808. ($n-- && bless {}, 'X') && redo;
  809. }
  810. cmp_ok($late_free,'==',0,"bug 27206: redo memory leak");
  811. $n = 10; $late_free = 0;
  812. {
  813. ($n-- && bless {}, 'X') && redo;
  814. }
  815. continue { }
  816. cmp_ok($late_free,'==',0,"bug 27206: redo with continue memory leak");
  817. }
  818. # ensure that redo doesn't clear a lexical declared in the condition
  819. {
  820. my $i = 1;
  821. while (my $x = $i) {
  822. $i++;
  823. redo if $i == 2;
  824. cmp_ok($x,'==',1,"while/redo lexical life");
  825. last;
  826. }
  827. $i = 1;
  828. until (! (my $x = $i)) {
  829. $i++;
  830. redo if $i == 2;
  831. cmp_ok($x,'==',1,"until/redo lexical life");
  832. last;
  833. }
  834. for ($i = 1; my $x = $i; ) {
  835. $i++;
  836. redo if $i == 2;
  837. cmp_ok($x,'==',1,"for/redo lexical life");
  838. last;
  839. }
  840. }
  841. {
  842. $a37725[3] = 1; # use package var
  843. $i = 2;
  844. for my $x (reverse @a37725) {
  845. $x = $i++;
  846. }
  847. cmp_ok("@a37725",'eq',"5 4 3 2",'bug 27725: reverse with empty slots bug');
  848. }
  849. # [perl #21469] bad things happened with for $x (...) { *x = *y }
  850. {
  851. my $i = 1;
  852. $x_21469 = 'X';
  853. $y1_21469 = 'Y1';
  854. $y2_21469 = 'Y2';
  855. $y3_21469 = 'Y3';
  856. for $x_21469 (1,2,3) {
  857. is($x_21469, $i, "bug 21469: correct at start of loop $i");
  858. *x_21469 = (*y1_21469, *y2_21469, *y3_21469)[$i-1];
  859. is($x_21469, "Y$i", "bug 21469: correct at tail of loop $i");
  860. $i++;
  861. }
  862. is($x_21469, 'X', "bug 21469: X okay at end of loop");
  863. }
  864. # [perl #112316] Wrong behavior regarding labels with same prefix
  865. {
  866. my $fail;
  867. CATCH: {
  868. CATCHLOOP: {
  869. last CATCH;
  870. }
  871. $fail = 1;
  872. }
  873. ok(!$fail, "perl 112316: Labels with the same prefix don't get mixed up.");
  874. }