1#!/usr/bin/perl -w 2 3# Test that setting $? doesn't affect subtest success 4 5use strict; 6use Test::More; 7 8subtest foo => sub { 9 plan tests => 1; 10 $? = 1; 11 pass('bar'); 12}; 13 14is $?, 1, "exit code keeps on from a subtest"; 15 16subtest foo2 => sub { 17 plan tests => 1; 18 pass('bar2'); 19 $? = 1; 20}; 21 22is $?, 1, "exit code keeps on from a subtest"; 23 24done_testing(4); 25