Author: bernhard
Date: Thu Jun 14 13:03:45 2007
New Revision: 19002
Modified:
trunk/languages/lisp/t/arithmetics.t
trunk/languages/lisp/t/basic.t
Log:
[languages/list]
Add tests for more functions from cl.pir.
Modified: trunk/languages/lisp/t/arithmetics.t
==============================================================================
--- trunk/languages/lisp/t/arithmetics.t (original)
+++ trunk/languages/lisp/t/arithmetics.t Thu Jun 14 13:03:45 2007
@@ -18,7 +18,7 @@
use lib "$FindBin::Bin/../lib", "$FindBin::Bin/../../../lib";
# core Perl modules
-use Test::More tests => 4;
+use Test::More tests => 5;
# Parrot modules
use Parrot::Test;
@@ -46,3 +46,9 @@
END_CODE
NIL
END_OUT
+
+language_output_is( 'Lisp', <<'END_CODE', <<'END_OUT', '2 equals 1+1' );
+( print ( mod 11 3 ) )
+END_CODE
+2
+END_OUT
Modified: trunk/languages/lisp/t/basic.t
==============================================================================
--- trunk/languages/lisp/t/basic.t (original)
+++ trunk/languages/lisp/t/basic.t Thu Jun 14 13:03:45 2007
@@ -79,15 +79,100 @@
q{2},
q{eval an addition},
],
+ [ q{ ( print "How does function work?" ) },
+ q{},
+ q{function},
+ todo => 'test the function function'
+ ],
+ [ q{ ( print ( gensym ) ) },
+ q{G000001},
+ ],
+ [ q{ ( gensym ) ( print *gensym-counter* ) },
+ q{2},
+ ],
+ [ q{ ( gensym )( gensym )( gensym ) ( print *gensym-counter* ) },
+ q{4},
+ ],
+ [ q{ ( if T ( print "T is true" ) ( print "T is false" ) ) },
+ q{T is true},
+ ],
+ [ q{ ( if NIL ( print "NIL is true" ) ( print "NIL is false" ) ) },
+ q{NIL is false},
+ ],
+ [ q{ ( if ( - 3 3 ) ( print "3-3 is true" ) ( print "3-3 is false" ) ) },
+ q{3-3 is true},
+ ],
+ [ q{ ( if ( + 3 3 ) ( print "3+3 is true" ) ( print "3+3 is false" ) ) },
+ q{3+3 is true},
+ ],
+ [ q{ ( "let" ) },
+ q{NIL},
+ q{let not tested yet},
+ todo => 'understand let'
+ ],
[ q{ ( print ( list 1 2 ) ) },
q{(1 . (2 . NIL))},
],
+ [ q{ ( print ( null nil ) ) },
+ q{T},
+ ],
+ [ q{ ( print ( null 1 ) ) },
+ q{NIL},
+ ],
+ [ q{ ( print ( null ' ( ) ) ) },
+ q{T},
+ ],
+ [ q{ ( print ( null T ) ) },
+ q{NIL},
+ ],
+ [ q{ ( print ( progn 1 ( + 1 1 ) ( + 1 1 1 ) ) ) },
+ q{3},
+ ],
[ q{ ( setq asdf 1234 ) ( print asdf ) },
q{1234},
],
+ [ q{ ( print ( quote ( + 1 1 ) ) ) },
+ q{(+ . (1 . (1 . NIL)))},
+ ],
+ [ q{ ( print ( quote '1 ) ) },
+ q{(QUOTE . (1 . NIL))},
+ ],
+ [ q{ ( print ( rplaca ( cons 1 2 ) 3 ) ) },
+ q{(3 . 2)},
+ ],
+ [ q{ ( print ( rplacd ( cons 1 2 ) 3 ) ) },
+ q{(1 . 3)},
+ ],
[ q{ ( setq asdf 1234 ) ( print asdf ) },
q{1234},
],
+ [ q{ ( setq asdf 1234 ) ( print ( type-of asdf ) ) },
+ q{INTEGER},
+ ],
+ [ q{ ( setq asdf 1234 ) ( print ( type-of 'asdf ) ) },
+ q{SYMBOL},
+ ],
+ [ q{ ( print ( type-of ( cons 1 2 ) ) ) },
+ q{CONS},
+ ],
+ [ q{ ( print ( type-of '( cons 1 2 ) ) ) },
+ q{CONS},
+ ],
+ [ q{ ( print ( type-of T ) ) },
+ q{BOOLEAN},
+ q{type-of T},
+ todo => q{sbcl says T is a BOOLEAN}
+ ],
+ [ q{ ( print ( type-of NIL ) ) },
+ q{NULL},
+ q{type-of NIL},
+ todo => q{sbcl says NIL is a NULL}
+ ],
+ [ q{ ( print (values 3 4 5 ) ) },
+ q{3},
+ q{values},
+ todo => 'values is not evalueted',
+ ],
);
Test::More::plan( tests => scalar @test_cases );