X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=t%2FCompiler.t;h=e50107aca0577c7c55aed950ba77d897d1bd0195;hb=04be023f8bc114edb6dddae6cee3bd58ea758561;hp=11718b1a642ca6bd13f9a368b57cebf7fbcc8f91;hpb=5b0ffaa8cdf6c0fd03fb5da89af11e27ade3778e;p=app-scheme79asm.git diff --git a/t/Compiler.t b/t/Compiler.t index 11718b1..e50107a 100644 --- a/t/Compiler.t +++ b/t/Compiler.t @@ -2,12 +2,14 @@ use strict; use warnings; -use Test::More tests => 31; -BEGIN { use_ok('App::Scheme79asm::Compiler', qw/pretty_print/) }; +use Data::Dump::Sexp; +use Test::More tests => 32; + +BEGIN { use_ok('App::Scheme79asm::Compiler') }; sub is_sexp { my ($expr, $expected, $name) = @_; - is pretty_print($expr), $expected, $name; + is dump_sexp($expr), $expected, $name; } sub to_sexp { @@ -26,6 +28,7 @@ sub is_toplevel { } is_sexp new->process_quoted(to_sexp '5'), '(SYMBOL 3)', 'process_quoted 5'; +is_sexp new->process_quoted(to_sexp 'NIL'), '(LIST 0)', 'process_quoted NIL'; is_sexp new->process_quoted(to_sexp '()'), '(LIST 0)', 'process_quoted ()'; is_sexp new->process_quoted(to_sexp '(5 foo)'), '(LIST (LIST (LIST 0) (SYMBOL 3)) (SYMBOL 4))', 'process_quoted (5 foo)'; is_sexp new->process_quoted(to_sexp '(((5)))'), '(LIST (LIST 0) (LIST (LIST 0) (LIST (LIST 0) (SYMBOL 3))))', 'process_quoted (((5)))'; @@ -43,8 +46,8 @@ is_toplevel '(lambda append (x y) (if (atom x) y (cons (car x) (append (cdr x) y sub pp_roundtrip { my ($string) = @_; - my $pp = uc App::Scheme79asm::Compiler::pretty_print(to_sexp $string); - is $pp, uc($string), "pretty_print roundtrip $string"; + my $pp = uc dump_sexp(to_sexp $string); + is $pp, uc($string), "dump_sexp roundtrip $string"; } pp_roundtrip '()';