Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 152 lines (137 sloc) 2.639 kb
58135b30 »
2008-05-08 [t/spec] changed 'use v6-alpha;' to 'use v6;'
1 use v6;
125e6706 »
2008-01-14 Test suite refactoring.
2
3 use Test;
4
5f108376 »
2008-01-28 [t] Converted pod markers to pod6
5 =begin pod
125e6706 »
2008-01-14 Test suite refactoring.
6
7 Basic tests for the ord() and chr() built-in.
8
5f108376 »
2008-01-28 [t] Converted pod markers to pod6
9 =end pod
125e6706 »
2008-01-14 Test suite refactoring.
10
11 # L<S29/Conversions/ord>
12 # L<S29/Conversions/chr>
13
14 # What is the best way to test 0 through 31??
15 my @maps = (
16 " ", 32,
17 "!", 33,
68ced3dc »
2008-07-20 [ord_and_chr.t] some malformed double-quoted strings
18 '"', 34,
125e6706 »
2008-01-14 Test suite refactoring.
19 "#", 35,
68ced3dc »
2008-07-20 [ord_and_chr.t] some malformed double-quoted strings
20 '$', 36,
125e6706 »
2008-01-14 Test suite refactoring.
21 "%", 37,
22 "&", 38,
68ced3dc »
2008-07-20 [ord_and_chr.t] some malformed double-quoted strings
23 "'", 39,
125e6706 »
2008-01-14 Test suite refactoring.
24 "(", 40,
25 ")", 41,
26 "*", 42,
27 "+", 43,
28 ",", 44,
29 "-", 45,
30 ".", 46,
31 "/", 47,
32 "0", 48,
33 "1", 49,
34 "2", 50,
35 "3", 51,
36 "4", 52,
37 "5", 53,
38 "6", 54,
39 "7", 55,
40 "8", 56,
41 "9", 57,
42 ":", 58,
43 ";", 59,
44 "<", 60,
45 "=", 61,
46 ">", 62,
47 "?", 63,
48 "@", 64,
49 "A", 65,
50 "B", 66,
51 "C", 67,
52 "D", 68,
53 "E", 69,
54 "F", 70,
55 "G", 71,
56 "H", 72,
57 "I", 73,
58 "J", 74,
59 "K", 75,
60 "L", 76,
61 "M", 77,
62 "N", 78,
63 "O", 79,
64 "P", 80,
65 "Q", 81,
66 "R", 82,
67 "S", 83,
68 "T", 84,
69 "U", 85,
70 "V", 86,
71 "W", 87,
72 "X", 88,
73 "Y", 89,
74 "Z", 90,
75 "[", 91,
76 "\\", 92,
77 "]", 93,
78 "^", 94,
79 "_", 95,
80 "`", 96,
81 "a", 97,
82 "b", 98,
83 "c", 99,
84 "d", 100,
85 "e", 101,
86 "f", 102,
87 "g", 103,
88 "h", 104,
89 "i", 105,
90 "j", 106,
91 "k", 107,
92 "l", 108,
93 "m", 109,
94 "n", 110,
95 "o", 111,
96 "p", 112,
97 "q", 113,
98 "r", 114,
99 "s", 115,
100 "t", 116,
101 "u", 117,
102 "v", 118,
103 "w", 119,
104 "x", 120,
105 "y", 121,
106 "z", 122,
14a6ccf3 »
2008-07-20 [ord_and_chr.t] typo - '{' is 123
107 '{', 123,
125e6706 »
2008-01-14 Test suite refactoring.
108 "|", 124,
68ced3dc »
2008-07-20 [ord_and_chr.t] some malformed double-quoted strings
109 '}', 125,
125e6706 »
2008-01-14 Test suite refactoring.
110 "~", 126,
111
112 # Unicode tests
113 "ä", 228,
114 "€", 8364,
115 "»", 187,
116 "«", 171,
117
118 # Special chars
119 "\o00", 0,
120 "\o01", 1,
121 "\o03", 3,
122 );
123
1b6d1d03 »
2009-01-29 [t] Added named arg tests for ord and chr
124 plan 36+@maps*2;
125e6706 »
2008-01-14 Test suite refactoring.
125
126 for @maps -> $char, $code {
127 my $descr = "\\{$code}{$code >= 32 ?? " == '{$char}'" !! ""}";
128 is ord($char), $code, "ord() works for $descr";
129 is chr($code), $char, "chr() works for $descr";
130 }
131
1b6d1d03 »
2009-01-29 [t] Added named arg tests for ord and chr
132 for @maps -> $char, $code {
133 my $descr = "\\{$code}{$code >= 32 ?? " == '{$char}'" !! ""}";
134 #?rakudo skip 'named args'
135 is ord(:string($char)), $code, "ord() works for $descr with named args";
136 #?rakudo skip 'named args'
137 is chr(:graph($code)), $char, "chr() works for $descr with named args";
138 }
139
125e6706 »
2008-01-14 Test suite refactoring.
140 for 0..31 -> $code {
141 my $char = chr($code);
142 is ord($char), $code, "ord(chr($code)) is $code";
143 }
144
d2ed6c4b »
2008-09-23 [ord_and_chr.t] added tests for ord and chr methods
145 is 'A'.ord, 65, "there's a .ord method";
146 is 65.chr, 'A', "there's a .chr method";
e6dc364d »
2008-09-24 [ord_and_chr.t] added tests for multi-arg variants of ord and chr
147
148 #?rakudo 2 skip 'multi-arg variants of ord and chr not in place yet'
149 is ord('hello'), [104, 101, 108, 108, 111], 'ord works with longer strings';
150 is chr(104, 101, 108, 108, 111), 'hello', 'chr works with a list of ints';
1b6d1d03 »
2009-01-29 [t] Added named arg tests for ord and chr
151 #vim: ft=perl6
Something went wrong with that request. Please try again.