Skip to content

Commit 6429cf8

Browse files
committed
De-tab and get indenting right
1 parent 62446ba commit 6429cf8

File tree

1 file changed

+61
-69
lines changed

1 file changed

+61
-69
lines changed

S06-advanced/wrap.t

Lines changed: 61 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ is(@log[1], "foo", "got execpted value from original sub");
8989

9090
dies_ok { &foo.unwrap($wrapped) }, "can't re-unwrap an already unwrapped sub";
9191

92-
93-
94-
# from wrapping.t
95-
9692
#First level wrapping
9793
sub hi { "Hi" };
9894
is( hi, "Hi", "Basic sub." );
@@ -126,10 +122,10 @@ lives_ok { &levelwrap.callwith( 1 )},
126122
{
127123
for (1..10) -> $num {
128124
lives_ok {
129-
&levelwrap.wrap({
130-
callwith( $^t + 1 );
131-
}),
132-
" Wrapping #$num"
125+
&levelwrap.wrap({
126+
callwith( $^t + 1 );
127+
}),
128+
" Wrapping #$num"
133129
}, "wrapping $num";
134130
is( levelwrap( 1 ), 1 + $num, "Checking $num level wrapping" );
135131
}
@@ -236,28 +232,27 @@ dies_ok { {nextsame}() }, '{nextsame}() dies properly';
236232
my $didfoo;
237233

238234
my role SomeTrait {
239-
method apply_handles($attr: Mu $pkg) {
240-
my $name = $attr.name;
241-
my $accessor = $name.subst(/^../, '');
242-
my $r = sub ($obj, |args) is rw {
243-
my (|c) ::= callsame;
244-
c;
245-
}
246-
$pkg.^find_method($accessor).wrap($r);
247-
}
248-
249-
method foo { $didfoo++ }
235+
method apply_handles($attr: Mu $pkg) {
236+
my $name = $attr.name;
237+
my $accessor = $name.subst(/^../, '');
238+
my $r = sub ($obj, |args) is rw {
239+
my (|c) ::= callsame;
240+
c;
241+
}
242+
$pkg.^find_method($accessor).wrap($r);
243+
}
244+
method foo { $didfoo++ }
250245
}
251246

252247
multi trait_mod:<is>(Attribute $var, :$wtf!) {
253-
die "Must have accessor" unless $var.has-accessor;
254-
$var.set_rw;
255-
$var does SomeTrait;
256-
$var.foo;
248+
die "Must have accessor" unless $var.has-accessor;
249+
$var.set_rw;
250+
$var does SomeTrait;
251+
$var.foo;
257252
}
258253

259254
my class foo {
260-
has $.x is rw is wtf = 16;
255+
has $.x is rw is wtf = 16;
261256
}
262257

263258
ok $didfoo, "Did foo, capture return";
@@ -273,27 +268,26 @@ dies_ok { {nextsame}() }, '{nextsame}() dies properly';
273268
my $didfoo;
274269

275270
my role SomeTrait {
276-
method apply_handles($attr: Mu $pkg) {
277-
my $name = $attr.name;
278-
my $accessor = $name.subst(/^../, '');
279-
my $r = sub ($obj, |args) is rw {
280-
return callsame;
281-
}
282-
$pkg.^find_method($accessor).wrap($r);
283-
}
284-
285-
method foo { $didfoo++ }
271+
method apply_handles($attr: Mu $pkg) {
272+
my $name = $attr.name;
273+
my $accessor = $name.subst(/^../, '');
274+
my $r = sub ($obj, |args) is rw {
275+
return callsame;
276+
}
277+
$pkg.^find_method($accessor).wrap($r);
278+
}
279+
method foo { $didfoo++ }
286280
}
287281

288282
multi trait_mod:<is>(Attribute $var, :$wtf!) {
289-
die "Must have accessor" unless $var.has-accessor;
290-
$var.set_rw;
291-
$var does SomeTrait;
292-
$var.foo;
283+
die "Must have accessor" unless $var.has-accessor;
284+
$var.set_rw;
285+
$var does SomeTrait;
286+
$var.foo;
293287
}
294288

295289
my class foo {
296-
has $.x is rw is wtf = 16;
290+
has $.x is rw is wtf = 16;
297291
}
298292

299293
ok $didfoo, "Did foo, return callsame";
@@ -309,27 +303,26 @@ dies_ok { {nextsame}() }, '{nextsame}() dies properly';
309303
my $didfoo;
310304

311305
my role SomeTrait {
312-
method apply_handles($attr: Mu $pkg) {
313-
my $name = $attr.name;
314-
my $accessor = $name.subst(/^../, '');
315-
my $r = sub ($obj, |args) is rw {
316-
callsame;
317-
}
318-
$pkg.^find_method($accessor).wrap($r);
319-
}
320-
321-
method foo { $didfoo++ }
306+
method apply_handles($attr: Mu $pkg) {
307+
my $name = $attr.name;
308+
my $accessor = $name.subst(/^../, '');
309+
my $r = sub ($obj, |args) is rw {
310+
callsame;
311+
}
312+
$pkg.^find_method($accessor).wrap($r);
313+
}
314+
method foo { $didfoo++ }
322315
}
323316

324317
multi trait_mod:<is>(Attribute $var, :$wtf!) {
325-
die "Must have accessor" unless $var.has-accessor;
326-
$var.set_rw;
327-
$var does SomeTrait;
328-
$var.foo;
318+
die "Must have accessor" unless $var.has-accessor;
319+
$var.set_rw;
320+
$var does SomeTrait;
321+
$var.foo;
329322
}
330323

331324
my class foo {
332-
has $.x is rw is wtf = 16;
325+
has $.x is rw is wtf = 16;
333326
}
334327

335328
ok $didfoo, "Did foo, callsame";
@@ -345,27 +338,26 @@ dies_ok { {nextsame}() }, '{nextsame}() dies properly';
345338
my $didfoo;
346339

347340
my role SomeTrait {
348-
method apply_handles($attr: Mu $pkg) {
349-
my $name = $attr.name;
350-
my $accessor = $name.subst(/^../, '');
351-
my $r = sub ($obj, |args) is rw {
352-
nextsame;
353-
}
354-
$pkg.^find_method($accessor).wrap($r);
355-
}
356-
357-
method foo { $didfoo++ }
341+
method apply_handles($attr: Mu $pkg) {
342+
my $name = $attr.name;
343+
my $accessor = $name.subst(/^../, '');
344+
my $r = sub ($obj, |args) is rw {
345+
nextsame;
346+
}
347+
$pkg.^find_method($accessor).wrap($r);
348+
}
349+
method foo { $didfoo++ }
358350
}
359351

360352
multi trait_mod:<is>(Attribute $var, :$wtf!) {
361-
die "Must have accessor" unless $var.has-accessor;
362-
$var.set_rw;
363-
$var does SomeTrait;
364-
$var.foo;
353+
die "Must have accessor" unless $var.has-accessor;
354+
$var.set_rw;
355+
$var does SomeTrait;
356+
$var.foo;
365357
}
366358

367359
my class foo {
368-
has $.x is rw is wtf = 16;
360+
has $.x is rw is wtf = 16;
369361
}
370362

371363
ok $didfoo, "Did foo, nextsame";

0 commit comments

Comments
 (0)