File: 14_pointcut_highest.t

package info (click to toggle)
libaspect-perl 1.04-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 720 kB
  • sloc: perl: 6,846; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 418 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl

use strict;
BEGIN {
	$|  = 1;
	$^W = 1;
}

use Test::More tests => 2;
use Test::NoWarnings;
use Aspect;

my $COUNT = 0;

sub foo {
	$COUNT += 1;
	return if $COUNT > 13;
	foo();
}

# Set up a simple permanent advice
around {
	$COUNT += 10;
	$_[0]->proceed;
} call 'main::foo'
& highest;

foo();

# At the end of the recursive call, did the advice only fire once?
is( $COUNT, 14, 'Advice fired once' );