Changeset 21157
- Timestamp:
- 07/02/08 03:02:00 (3 months ago)
- Files:
-
- 1 modified
-
t/spec/S29-list/reverse.t (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
t/spec/S29-list/reverse.t
r20702 r21157 10 10 =end pod 11 11 12 plan 4 5;12 plan 49; 13 13 14 14 # As a function : … … 32 32 is( '䀻«'.reverse, '«»€ä', "some unicode characters" ); 33 33 34 35 # L<S29/"List"/"=item reverse">36 34 37 35 =begin pod … … 151 149 is(@b[0], (@b.reverse)[0], 'one item list is left alone'); 152 150 } 151 152 =begin pod 153 154 Tests for %hash.reverse, which inverts the keys and values of a hash. 155 156 =end pod 157 158 { 159 my %hash = <a b c d>; 160 is(%hash.reverse, {'b' => 'a', 'd' => 'c'}, 'simple hash reversal'); 161 is(%hash, {'a' => 'b', 'c' => 'd'}, 'original hash is intact'); 162 } 163 164 { 165 my %hash = reverse {0 => 'a', 1 => 'a'}; 166 167 is(%hash.keys, <a>, 'hash reversal with collision (unspecced, keys)'); 168 is(%hash.values.sort, <0 1>, 'hash reversal with collision (unspecced, values)'); 169 }
