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.
16 use Test::More tests => 34;
19 use Language::Befunge;
20 my $bef = Language::Befunge->new;
24 $bef->store_code( ',q' );
25 stdout_is { $bef->run_code } chr(0), 'empty stack, string output';
26 $bef->store_code( '.q' );
27 stdout_is { $bef->run_code } '0 ', 'empty stack, numeral output';
31 foreach my $c ( 0 .. 9, 'a' .. 'f' ) {
33 $bef->store_code( "$c,q" );
34 stdout_is { $bef->run_code } chr($n), "$c, string output";
35 $bef->store_code( "$c.q" );
36 stdout_is { $bef->run_code } "$n ", "$c, numeral output";