7 use Catalyst::Test 'KeepStash';
11 $content = get('/subrequest_keepstash_index');
13 # Because of the way SubRequest and Catalyst interact, the first level of the stash will get copied. On return to the root request,
14 # the first level of the stash will remain intact. Deep datastructures will be changed by subrequests, though
15 like($content, qr/-------ROOT------------\nShallow value: 5\nDeep Value: 9\n/, 'Got expected values in the stash');
16 like($content, qr/-------1st-------------\nShallow value: 6\nDeep Value: 10\nNew Value: \n/, 'Got expected values in the 1st call');
17 like($content, qr/-------2nd-------------\nShallow value: 6\nDeep Value: 11\nNew Value: \n/, 'Got expected values in the 2nd call');
19 $content = get('/visit_keepstash_index');
20 like($content, qr/-------ROOT------------\nShallow value: 5\nDeep Value: 9\n/, 'Got expected values in the stash');
21 like($content, qr/-------1st-------------\nShallow value: 6\nDeep Value: 10\nNew Value: \n/, 'Got expected values in the 1st call');
22 like($content, qr/-------2nd-------------\nShallow value: 7\nDeep Value: 11\nNew Value: new\n/, 'Got expected values in the 2nd call');