Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 34 lines (21 sloc) 0.969 kb
58135b3 [t/spec] changed 'use v6-alpha;' to 'use v6;'
moritz authored
1 use v6;
4d29ac3 Converted some *.t scripts to unix format (?)
cosimo authored
2 use Test;
3
db6b784 [t/spec] fix smartlinks in S32-str
moritz authored
4 # L<S32::Str/Str/"=item samecase">
4d29ac3 Converted some *.t scripts to unix format (?)
cosimo authored
5
f660aa6 [t/spec] Possibly converted all remaining pod markers to pod6
cosimo authored
6 =begin pod
4d29ac3 Converted some *.t scripts to unix format (?)
cosimo authored
7
8 Basic test for the samecase() builtin with a string (Str).
9
f660aa6 [t/spec] Possibly converted all remaining pod markers to pod6
cosimo authored
10 =end pod
4d29ac3 Converted some *.t scripts to unix format (?)
cosimo authored
11
85d2267 Moritz Lenz [S32] more unfossiling
moritz authored
12 plan 8;
4d29ac3 Converted some *.t scripts to unix format (?)
cosimo authored
13
14 # As a function
15 is( samecase('Perl6', 'abcdE'), 'perl6', 'as a function');
16
17 # As a method
18 is( ''.samecase(''), '', 'empty string' );
19 is( 'Hello World !'.samecase('AbCdEfGhIjKlMnOpQrStUvWxYz'), 'HeLlO WoRlD !', 'literal');
55c5f29 Skip tests calling positional parameters by name.
cspencer authored
20
4d29ac3 Converted some *.t scripts to unix format (?)
cosimo authored
21
22 # On a variable
23 my Str $a = 'Just another Perl6 hacker';
24 is( $a.samecase('XXXXXXXXXXXXXXXXXXXXXXXXX'), 'JUST ANOTHER PERL6 HACKER', 'with a Str variable' );
25 is( $a.samecase('äääääääääääääääääääääääää'), 'just another perl6 hacker', 'with a Str variable and <unicode> arg');
26 is( $a, 'Just another Perl6 hacker', 'samecase should not be in-place' );
27 is( $a .= samecase('aaaaaaaaaaaaaaaaaaaaaaaa'), 'just another perl6 hacker', 'after a .= samecase(...)' );
28
29 # samecase with unicode
30 is( '䀻«'.samecase('xXxX'), '䀻«', 'some unicode characters' );
31
7f29bc5 [t/spec] Add vim: lines everywhere.
kyle authored
32
33 # vim: ft=perl6
Something went wrong with that request. Please try again.