/[VRac]/t/07-tape.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /t/07-tape.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 145 - (hide annotations)
Sun Aug 5 13:27:27 2007 UTC (12 years, 6 months ago) by dpavlin
File MIME type: application/x-troff
File size: 679 byte(s)
- sessions which allows you to record your interaction with machine
- tape writer which create file on disk
- improved pod for VRac

1 dpavlin 109 #!/usr/bin/perl
2    
3     use warnings;
4     use strict;
5    
6     use blib;
7     use lib './lib';
8    
9     use Test::More tests => 18;
10     use Data::Dump qw/dump/;
11 dpavlin 145 use File::Slurp;
12 dpavlin 109
13     BEGIN {
14     use_ok( 'Tape' );
15     }
16    
17     ok( my $tape = Tape->new(), 'new' );
18    
19     isa_ok( $tape, 'Tape' );
20    
21     ok( ! $tape->tape, 'empty' );
22     ok( ! $tape->tape_pos, 'no pos' );
23    
24     ok( $tape->load_tape( $0 ), 'load' );
25     cmp_ok( $tape->tape_pos, '==', 0, 'pos 0' );
26    
27     my $buff;
28     my $len = 10;
29     for ( 1 .. $len ) {
30     ok( $buff .= chr($tape->read_tape), 'read_tape' );
31     }
32    
33 dpavlin 132 my $expect = "\0\0\xFF\xFF\0\0\xFF\xFF\0\0";
34 dpavlin 109
35 dpavlin 132 cmp_ok( $buff, 'eq', $expect, 'no tape error :-)' );
36    
37 dpavlin 145 my $data = read_file( $0 );
38    
39     foreach my $b ( split(//, $data) ) {
40     $tape->write_tape( $b );
41     }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26