Skip to content

Commit

Permalink
[t/spec] remove Windows line endings from S06-signature/type-capture.t
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@24152 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
hinrik committed Dec 4, 2008
1 parent 9511a2f commit 7ca904f
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions S06-signature/type-capture.t
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
use v6;
use Test;

plan 7;

# Check it captures built-in types.
sub basic_capture(::T $x) { ~T }
is(basic_capture(42), 'Int', 'captured built-in type');
is(basic_capture(4.2), 'Num', 'captured built-in type');

# User defined ones too.
class Foo { }
is(basic_capture(Foo.new), 'Foo', 'captured user defined type');

# Check you can use captured type later in the signature.
sub two_the_same(::T $x, T $y) { 1 }
ok(two_the_same(42, 42), 'used captured type later in the sig');
my $ok = 1;
try {
two_the_same(42, 4.2);
$ok = 0;
}
ok($ok, 'used captured type later in the sig');

# Check you can use them to declare variables.
sub declare_cap_type(::T $x) {
my T $y = 4.2;
1
}
ok(declare_cap_type(3.3), 'can use captured type in declaration');
$ok = 1;
try {
declare_cap_type(42);
$ok = 0;
}
ok($ok, 'can use captured type in declaration');
plan 7;

# Check it captures built-in types.
sub basic_capture(::T $x) { ~T }
is(basic_capture(42), 'Int', 'captured built-in type');
is(basic_capture(4.2), 'Num', 'captured built-in type');

# User defined ones too.
class Foo { }
is(basic_capture(Foo.new), 'Foo', 'captured user defined type');

# Check you can use captured type later in the signature.
sub two_the_same(::T $x, T $y) { 1 }
ok(two_the_same(42, 42), 'used captured type later in the sig');
my $ok = 1;
try {
two_the_same(42, 4.2);
$ok = 0;
}
ok($ok, 'used captured type later in the sig');

# Check you can use them to declare variables.
sub declare_cap_type(::T $x) {
my T $y = 4.2;
1
}
ok(declare_cap_type(3.3), 'can use captured type in declaration');
$ok = 1;
try {
declare_cap_type(42);
$ok = 0;
}
ok($ok, 'can use captured type in declaration');

0 comments on commit 7ca904f

Please sign in to comment.