~ubuntu-branches/ubuntu/trusty/clc-intercal/trusty-proposed

« back to all changes in this revision

Viewing changes to t/01ebcdic.t

  • Committer: Bazaar Package Importer
  • Author(s): Mark Brown
  • Date: 2006-10-08 13:30:54 UTC
  • mfrom: (1.1.1 upstream) (3.1.1 dapper)
  • Revision ID: james.westby@ubuntu.com-20061008133054-fto70u71yoyltr3m
Tags: 1:1.0~2pre1.-94.-4.1-1
* New upstream release.
* Change to dh_installman.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
use Charset::EBCDIC qw(ebcdic2ascii ascii2ebcdic ebcdic2cards);
2
 
 
3
 
my $ascii = "Hello, World!\n";
4
 
my $ebcdic = "\310\205\223\223\226\153\100\346\226\231\223\204\117\n";
5
 
my $ebcdic2 = substr($ebcdic, 0, (length $ebcdic) - 1)
6
 
            . "\100" x (81 - length $ebcdic);
7
 
my $ebcdic3 = (substr($ebcdic, 0, (length $ebcdic) - 1) x 10 . "\n") x 16;
8
 
my $ebcdic4 = (substr($ebcdic, 0, (length $ebcdic) - 1) x 6 . "\310\205") x 16;
9
 
 
10
 
print ebcdic2ascii("\361\113\113\364\n");
11
 
 
12
 
print $ascii eq ebcdic2ascii($ebcdic) ? "" : ebcdic2ascii("\225\226\243\100"),
13
 
      ebcdic2ascii("\226\222\100\361\n");
14
 
 
15
 
print $ebcdic eq ascii2ebcdic($ascii) ? "" : ebcdic2ascii("\225\226\243\100"),
16
 
      ebcdic2ascii("\226\222\100\362\n");
17
 
 
18
 
print $ebcdic2 eq ebcdic2cards($ebcdic) ? "" : ebcdic2ascii("\225\226\243\100"),
19
 
      ebcdic2ascii("\226\222\100\363\n");
20
 
 
21
 
print $ebcdic4 eq ebcdic2cards($ebcdic3)
22
 
                ? "" : ebcdic2ascii("\225\226\243\100"),
23
 
      ebcdic2ascii("\226\222\100\364\n");
24