File: odd_number.t

package info (click to toggle)
libmethod-signatures-perl 20141021-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 620 kB
  • ctags: 133
  • sloc: perl: 3,561; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 596 bytes parent folder | download | duplicates (7)
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
#!/usr/bin/perl -w

package Foo;

use strict;
use Test::Warn;
use Test::More 'no_plan';

use Method::Signatures;

method foo(:$name, :$value) {
    return $name, $value;
}


TODO: {
    # Test::Warn is having issues with $TODO.
    Test::More->builder->todo_start("Odd number of elements should happen at the caller");

#line 20
    my @result;
    warning_like {
        @result = Foo->foo(name => 42, value =>);
    } qr/^Odd number of elements in hash assignment at \Q$0\E line 22.$/;

    Test::More->builder->todo_end;

    # Or should it be an error?
    is_deeply \@result, [42, undef];
}