syntax trefunge98 now supported
[language-befunge.git] / t / 2-ops / dir_go_away.t
blobeee88b4c8dbcd55d00472bb08190b6861957ed02
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 use Language::Befunge::Ops;
13 use strict;
14 use warnings;
16 use Language::Befunge::Interpreter;
17 use Language::Befunge::IP;
18 use Language::Befunge::Ops;
19 use Language::Befunge::Vector;
20 use Test::More tests => 1;
22 my ($lbi, $ip, $v);
25 $lbi = Language::Befunge::Interpreter->new;
26 $ip  = Language::Befunge::IP->new;
27 $v   = Language::Befunge::Vector->new(4,4);
28 $ip->set_delta( $v );
29 $lbi->set_curip( $ip );
30 Language::Befunge::Ops::dir_go_away( $lbi );
31 like( $ip->get_delta, qr/^\((-?1|0),(-?1|0)\)$/,
32       'dir_go_away forces a cardinal direction as new direction' );