Show
Ignore:
Timestamp:
04/16/08 08:56:33 (5 years ago)
Author:
kazuho
Message:

rewrite var holder parser

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Filter-SQL/trunk/t/01-simple.t

    r9544 r9545  
    1111        plan skip_all => 'Set FILTER_SQL_DBI to run these tests'; 
    1212    } else { 
    13         plan tests => 18; 
     13        plan tests => 24; 
    1414    } 
    1515}; 
     
    3030$a = "foo'a"; 
    3131is(SELECT ROW $a;, $a); 
     32is(SELECT ROW ${a};, $a); 
    3233is(SELECT ROW "hoge$a";, "hoge$a"); 
    3334is(SELECT ROW 'hoge$a';, 'hoge$a'); 
     35$a = [ 5 ]; 
     36is(SELECT ROW $a->[0+0]+1;, 6); 
     37$a = { foo => 3 }; 
     38is(SELECT ROW $a->{foo}-1;, 2); 
     39 
     40is(SELECT ROW {1 + 2};, 3); 
    3441 
    3542ok(SQL DROP TABLE IF EXISTS filter_sql_t;); 
     
    4047} 
    4148 
     49my $sth = EXEC SELECT v FROM filter_sql_t;; 
     50ok($sth); 
     51is_deeply( 
     52    $sth->fetchall_arrayref, 
     53    [ [ 0 ], [ 1 ], [ 2 ], ], 
     54); 
     55 
    4256is_deeply( 
    4357    [ SELECT * FROM filter_sql_t; ],