moved lbi:storage accessor to get_storage()
[language-befunge.git] / t / 6-library / TEST-noplan.t
blobe0b7709ec3471fc3300c487b9d19352a52d858a5
1 #!perl
3 # This file is part of Language::Befunge.
4 # Copyright (c) 2001-2008 Jerome Quelin, all rights reserved.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the same terms as Perl itself.
11 #--------------------------------#
12 #          TEST library          #
13 #--------------------------------#
15 use strict;
16 use Language::Befunge;
17 use POSIX qw! tmpnam !;
18 use Test::More;
20 # Vars.
21 my $file;
22 my $fh;
23 my $tests;
24 my $out;
25 my $bef = Language::Befunge->new;
26 BEGIN { $tests = 0 };
28 # In order to see what happens...
29 sub sel () {
30     $file = tmpnam();
31     open OUT, ">$file" or die $!;
32     $fh = select OUT;
34 sub slurp () {
35     select $fh;
36     close OUT;
37     open OUT, "<$file" or die $!;
38     my $content;
39     {
40         local $/;
41         $content = <OUT>;
42     }
43     close OUT;
44     unlink $file;
45     return $content;
48 # TEST.pm and this test script share the same plan.
52 #$bef->set_DEBUG(1);
53 # plan (no_plan)
54 $bef->store_code( <<'END_OF_CODE' );
55 0"TSET"4(#@0P)@
56 END_OF_CODE
57 $bef->run_code;
59 # ok
60 sel;
61 $bef->store_code( <<'END_OF_CODE' );
62 0"TSET"4(0"dnammoc O"1O)@
63 END_OF_CODE
64 $bef->run_code;
66 # is
67 sel;
68 $bef->store_code( <<'END_OF_CODE' );
69 0"TSET"4(0"dnammoc I"44I)@
70 END_OF_CODE
71 $bef->run_code;