Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 35 lines (28 sloc) 0.853 kb
a9be27a4 »
2009-01-03 add pack/unpack tests from perl 5 source code
1 use v6;
2 use Test;
3
db6b7849 »
2009-04-26 [t/spec] fix smartlinks in S32-str
4 # L<S32::Str/Str/"=item pack">
a9be27a4 »
2009-01-03 add pack/unpack tests from perl 5 source code
5
6c00c9bc »
2010-08-15 [t/spec/S32-str] added pack.t/unpack.t for the new Rakudo &pack/&unpack
6 plan 3;
a9be27a4 »
2009-01-03 add pack/unpack tests from perl 5 source code
7
8 {
6c00c9bc »
2010-08-15 [t/spec/S32-str] added pack.t/unpack.t for the new Rakudo &pack/&unpack
9 my $buf = pack('H*', "414243");
10 is_deeply $buf.contents, [:16<41>, :16<42>, :16<43>], 'H* works';
11 }
a9be27a4 »
2009-01-03 add pack/unpack tests from perl 5 source code
12
6c00c9bc »
2010-08-15 [t/spec/S32-str] added pack.t/unpack.t for the new Rakudo &pack/&unpack
13 {
14 my $buf = pack("A11 A28 A8 A*",
15 "03/23/2001", "Totals", "1235.00", " 1172.98");
16 is_deeply $buf.contents,
17 "03/23/2001 Totals 1235.00 1172.98"\
18 .encode.contents,
19 "A works";
a9be27a4 »
2009-01-03 add pack/unpack tests from perl 5 source code
20 }
21
6c00c9bc »
2010-08-15 [t/spec/S32-str] added pack.t/unpack.t for the new Rakudo &pack/&unpack
22 {
23 my $buf = pack("C S L n N v V",
24 0x130, 0x10030, 0x100000030,
25 0x1234, 0x12345678,
26 0x1234, 0x12345678);
27 is_deeply $buf.contents,
28 [0x30, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00,
29 0x12, 0x34, 0x12, 0x34, 0x56, 0x78,
30 0x34, 0x12, 0x78, 0x56, 0x34, 0x12],
31 "C S L n N v V work";
32 }
3b977f17 »
2010-08-16 [t/spec] added missing 'plan' and footer to recent files
33
34 # vim: ft=perl6
Something went wrong with that request. Please try again.