Lines Matching refs:template

237 print "# test the 'p' template\n";
352 # test the ascii template types (A, a, Z)
370 my ($what, $template, $in, $out) = @$_;
371 my $got = $what eq 'u' ? (unpack $template, $in) : (pack $template, $in);
374 print "# ${un}pack ('$template', "._qq($in).') gave '._qq($out).
734 my ($template, @in) = @$_;
736 my $got = eval {pack $template, @in};
739 printf "# pack ('$template', %s) gave %s expected %s\n",
754 my ($template, $in, @out) = @$_;
755 my @got = eval {unpack $template, $in};
758 printf "# list unpack ('$template', %s) gave %s expected %s\n",
761 my $got = eval {unpack $template, $in};
765 or printf "# scalar unpack ('$template', %s) gave %s expected %s\n",
1076 foreach my $template (qw(A Z c C s S i I l L n N v V q Q j J f d F D u U w)) {
1078 my $packed = eval {pack "${template}4", 1, 4, 9, 16};
1080 die unless $@ =~ /Invalid type '$template'/;
1081 skip ("$template not supported on this perl",
1082 $cant_checksum{$template} ? 4 : 8);
1084 my @unpack4 = unpack "${template}4", $packed;
1085 my @unpack = unpack "${template}*", $packed;
1086 my @unpack1 = unpack "${template}", $packed;
1087 my @unpack1s = scalar unpack "${template}", $packed;
1088 my @unpack4s = scalar unpack "${template}4", $packed;
1089 my @unpacks = scalar unpack "${template}*", $packed;
1091 my @tests = ( ["${template}4 vs ${template}*", \@unpack4, \@unpack],
1092 ["scalar ${template} ${template}", \@unpack1s, \@unpack1],
1093 ["scalar ${template}4 vs ${template}", \@unpack4s, \@unpack1],
1094 ["scalar ${template}* vs ${template}", \@unpacks, \@unpack1],
1097 unless ($cant_checksum{$template}) {
1098 my @unpack4_c = unpack "\%${template}4", $packed;
1099 my @unpack_c = unpack "\%${template}*", $packed;
1100 my @unpack1_c = unpack "\%${template}", $packed;
1101 my @unpack1s_c = scalar unpack "\%${template}", $packed;
1102 my @unpack4s_c = scalar unpack "\%${template}4", $packed;
1103 my @unpacks_c = scalar unpack "\%${template}*", $packed;
1106 ( ["% ${template}4 vs ${template}*", \@unpack4_c, \@unpack_c],
1107 ["% scalar ${template} ${template}", \@unpack1s_c, \@unpack1_c],
1108 ["% scalar ${template}4 vs ${template}*", \@unpack4s_c, \@unpack_c],
1109 ["% scalar ${template}* vs ${template}*", \@unpacks_c, \@unpack_c],