Permalink
Browse files

[Lua]

- test
  • Loading branch information...
fperrad
fperrad committed Apr 10, 2007
1 parent f87ff50 commit c35fa1040a27e0648f1ce993035b957d709fb607
Showing with 24 additions and 7 deletions.
  1. +1 −1 t/os.t
  2. +18 −6 t/package.t
  3. +5 −0 t/shootout.t
View
2 t/os.t
@@ -40,7 +40,7 @@ CODE
OUTPUT
language_output_is( 'lua', << 'CODE', << 'OUTPUT', 'function os.date' );
-print(os.date("!%c", 0))
+print(os.date("!%d/%m/%y %H:%M:%S", 0))
CODE
01/01/70 00:00:00
OUTPUT
View
@@ -25,7 +25,7 @@ use warnings;
use FindBin;
use lib "$FindBin::Bin";
-use Parrot::Test tests => 15;
+use Parrot::Test tests => 16;
use Test::More;
language_output_is( 'lua', << 'CODE', << 'OUTPUT', 'function module' );
@@ -124,14 +124,27 @@ CODE
1234
OUTPUT
-TODO:
-{
- local $TODO = 'need setfenv';
+TODO: {
+ local $TODO = 'require calls the loader with a single argument: modname';
+
+unlink('../foo.lua') if ( -f '../foo.lua' );
+open $X, '>', '../foo.lua';
+print {$X} 'print(...)';
+close $X;
+
+language_output_is( 'lua', << 'CODE', << 'OUTPUT', 'function require (arg)' );
+require "foo"
+CODE
+foo
+OUTPUT
+}
unlink('../complex.lua') if ( -f '../complex.lua' );
open $X, '>', '../complex.lua';
print {$X} << 'CODE';
-module(...)
+-- print("complex.lua", ...)
+-- module(...)
+module("complex")
function new (r, i) return {r=r, i=i} end
@@ -168,7 +181,6 @@ print(complex.i.r, complex.i.i)
CODE
0 1
OUTPUT
-}
SKIP:
{
View
@@ -58,9 +58,14 @@ language_output_is( 'lua', $code, $out, 'partial-sums', params => '25000');
# Generate and write random DNA sequences
#
+TODO:
+{
+ local $TODO = 'broken';
+
$code = Parrot::Test::slurp_file(File::Spec->catfile( @dir, 'fasta.lua-2.lua' ));
$out = Parrot::Test::slurp_file(File::Spec->catfile( @dir, 'fasta-output.txt' ));
language_output_is( 'lua', $code, $out, 'fasta', params => '1000' );
+}
#
# pidigits

0 comments on commit c35fa10

Please sign in to comment.