~ubuntu-branches/ubuntu/karmic/libsignatures-perl/karmic

« back to all changes in this revision

Viewing changes to t/basic.t

  • Committer: Bazaar Package Importer
  • Author(s): Ryan Niebur
  • Date: 2009-05-18 20:34:44 UTC
  • Revision ID: james.westby@ubuntu.com-20090518203444-ee3iqibpk6uxo7u8
Tags: upstream-0.05
ImportĀ upstreamĀ versionĀ 0.05

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
use strict;
 
2
use warnings;
 
3
use Test::More tests => 5;
 
4
 
 
5
use signatures;
 
6
 
 
7
sub foo ($bar) { $bar }
 
8
 
 
9
sub korv ($wurst, undef, $birne) {
 
10
    return "${wurst}-${birne}";
 
11
}
 
12
 
 
13
sub array ($scalar, @array) {
 
14
    return $scalar + @array;
 
15
}
 
16
 
 
17
sub hash (%hash) {
 
18
    return keys %hash;
 
19
}
 
20
 
 
21
sub Name::space ($moo) { $moo }
 
22
 
 
23
is(foo('baz'), 'baz');
 
24
is(korv(qw/a b c/), 'a-c');
 
25
is(array(10, 1..10), 20);
 
26
is_deeply(
 
27
    [sort(hash(foo => 1, bar => 2))],
 
28
    [sort(qw/foo bar/)],
 
29
);
 
30
 
 
31
is(Name::space('kooh'), 'kooh');