3 # This file is part of Language::Befunge.
4 # Copyright (c) 2001-2009 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 => 6;
19 use Language::Befunge;
20 my $bef = Language::Befunge->new;
24 $bef->store_code( <<'END_OF_CODE' );
28 stdout_is { $bef->run_code } '2 1 ', 'basic concurrency';
31 # q kills all ips running
32 $bef->store_code( <<'END_OF_CODE' );
36 stdout_is { $bef->run_code } '', 'q kills all ips running';
40 $bef->store_code( <<'END_OF_CODE' );
44 stdout_is { $bef->run_code } '3 3 2 2 1 1 ', 'threading clones the stack';
47 # spaces are one no-op
48 $bef->store_code( <<'END_OF_CODE' );
52 stdout_is { $bef->run_code } '1 2 ', 'spaces are one no-op';
55 # comments are one no-op
56 $bef->store_code( <<'END_OF_CODE' );
58 >;this is a comment;1.@
60 stdout_is { $bef->run_code } '1 2 ', 'comments are one no-op';
63 # repeat instructions are one op
64 $bef->store_code( <<'END_OF_CODE' );
68 stdout_is { $bef->run_code } '1 1 2 1 ', 'repeat instr is one op';