Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

Commit

Permalink
[Lua]
Browse files Browse the repository at this point in the history
- test
  • Loading branch information
fperrad committed Apr 10, 2007
1 parent f87ff50 commit c35fa10
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
2 changes: 1 addition & 1 deletion t/os.t
Expand Up @@ -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
Expand Down
24 changes: 18 additions & 6 deletions t/package.t
Expand Up @@ -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' );
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -168,7 +181,6 @@ print(complex.i.r, complex.i.i)
CODE
0 1
OUTPUT
}

SKIP:
{
Expand Down
5 changes: 5 additions & 0 deletions t/shootout.t
Expand Up @@ -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
Expand Down

0 comments on commit c35fa10

Please sign in to comment.