Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 56 lines (43 sloc) 1.73 kb
0b0a1ebd » moritz
2008-12-22 [t/spec]
1 use v6;
2 use Test;
3
645235fd » moritz
2011-09-30 test that writing to the symbol table does not affect methods; RT #69350
4 plan 12;
0b0a1ebd » moritz
2008-12-22 [t/spec]
5
8aaac760 » diakopter
2011-08-11 fix a bunch of smartlinks in S12, broken by me and TimToady++
6 # L<S12/Fancy method calls/"no space between the method name and the left parenthesis">
0b0a1ebd » moritz
2008-12-22 [t/spec]
7
8 class A {
9 multi method doit () { 'empty' };
10 multi method doit ($a, $b, *@rest) {
42773a9e » lwall
2009-01-26 [STD] improved error messages on prec errors, misplaced invocant colons
11 "a:$a|b:{$b}!" ~ @rest.join('!');
0b0a1ebd » moritz
2008-12-22 [t/spec]
12 }
13 }
14
15 $_ = A.new();
16
17 is .doit, 'empty', 'plain call with no args';
18 is .doit(), 'empty', 'method call with parens and no args';
19 eval_dies_ok '.doit ()', '.doit () illegal';
20 is .doit\ (), 'empty', 'method call with unspace';
21
22 is (.doit: 1, 2, 3), 'a:1|b:2!3', 'list op with colon';
23 is (.doit: 1, 2, 3, 4), 'a:1|b:2!3!4', 'list op with colon, slurpy';
ea41904e » lwall
2009-03-12 [STD] special named forms foo() .foo() and $.foo() no longer support
24 #?rakudo 3 skip 'switch-from-paren-to-listop form'
69f10759 » colomon
2012-01-12 Fudge for niecza.
25 #?niecza 3 skip 'Interaction between semiargs and args is not understood'
0b0a1ebd » moritz
2008-12-22 [t/spec]
26 is (.doit(1): 2, 3), 'a:1|b:2!3', 'list op with colon';
27 is (.doit(1, 2): 3), 'a:1|b:2!3', 'list op with colon';
28 is (.doit\ (1, 2): 3), 'a:1|b:2!3', 'list op with colon, unspace';
29
8aaac760 » diakopter
2011-08-11 fix a bunch of smartlinks in S12, broken by me and TimToady++
30 # L<S12/Fancy method calls/"if any term in a list is a bare closure">
0b0a1ebd » moritz
2008-12-22 [t/spec]
31 #?rakudo skip 'adverbial closures'
69f10759 » colomon
2012-01-12 Fudge for niecza.
32 #?niecza skip 'Excess arguments to Any.map, used 2 of 4 positionals'
0b0a1ebd » moritz
2008-12-22 [t/spec]
33 is (1..8).grep: { $_ % 2 }.map: { $_ - 1}.join('|'), '0|2|4|6',
34 'adverbial closure has right precedence and associativity';
35
d1a452b0 » moritz
2009-06-12 [t/spec] RT #61988, $.foo form did not accept arguments
36 # Used to be Rakudo RT #61988, $.foo form didn't accept arguments
37
69f10759 » colomon
2012-01-12 Fudge for niecza.
38 {
39 class B {
40 method a ($a, $b) { $a + $b }
41 method b { $.a(2, 3) }
42 }
d1a452b0 » moritz
2009-06-12 [t/spec] RT #61988, $.foo form did not accept arguments
43
69f10759 » colomon
2012-01-12 Fudge for niecza.
44 is B.new.b, 5, '$.a can accept arguments';
45 }
d1a452b0 » moritz
2009-06-12 [t/spec] RT #61988, $.foo form did not accept arguments
46
645235fd » moritz
2011-09-30 test that writing to the symbol table does not affect methods; RT #69350
47 # RT #69350
48 # test that you can't manipulate methods by writinig to the symbol table
49 {
50 class Manip { method a { 1} };
51 &Manip::a = sub ($:) { 2 };
52 is Manip.new.a, 1, 'Writing to a symbol table does not alter methods';
53 }
54
d1a452b0 » moritz
2009-06-12 [t/spec] RT #61988, $.foo form did not accept arguments
55
0b0a1ebd » moritz
2008-12-22 [t/spec]
56 # vim: ft=perl6
Something went wrong with that request. Please try again.