Author: tewk
Date: Fri Dec  5 08:56:35 2008
New Revision: 33514

Added:
   trunk/ext/SQLite3/t/test.p6   (contents, props changed)
      - copied, changed from r33513, /trunk/ext/SQLite3/test.p6
Removed:
   trunk/ext/SQLite3/test.p6
Modified:
   trunk/ext/SQLite3/Makefile.in

Log:
[sqlite3] make test


Modified: trunk/ext/SQLite3/Makefile.in
==============================================================================
--- trunk/ext/SQLite3/Makefile.in       (original)
+++ trunk/ext/SQLite3/Makefile.in       Fri Dec  5 08:56:35 2008
@@ -64,13 +64,16 @@
 .c$(O) :
        @$(CC) "" $(CFLAGS) -I$(@D) @[EMAIL PROTECTED]@ -c $<
 
+#PERL6=../../perl6
+PERL6=../../parrot ../../languages/perl6/perl6.pbc
 
 all :
        cd ../..; make perl6
-       cd ../../compilers/ncigen/; ../../parrot 
../../languages/perl6/perl6.pbc gen_sqlite3.pl /usr/include/sqlite3.h > 
../../ext/SQLite3/genSQLite3.pir
+       cd ../../compilers/ncigen/; $(PERL6) gen_sqlite3.pl 
/usr/include/sqlite3.h > ../../ext/SQLite3/genSQLite3.pir
 
 test:
-       ../../parrot ../../languages/perl6/perl6.pbc test.p6
+       $(RM_F) test.db t/test.db
+       PERL6LIB=../../languages/perl6 $(PERL6) t/test.p6
        
 
 $(SHARED_LIB) : $(C_FILES)

Copied: trunk/ext/SQLite3/t/test.p6 (from r33513, /trunk/ext/SQLite3/test.p6)
==============================================================================
--- /trunk/ext/SQLite3/test.p6  (original)
+++ trunk/ext/SQLite3/t/test.p6 Fri Dec  5 08:56:35 2008
@@ -3,18 +3,18 @@
 use DBDI;
 use Test;
 
-plan 1;
+plan 5;
 
 my $conn = DBDI::DriverManager.getConnection("dbdi:SQLite3:test.db", "", "");
-### isa_ok($conn, 'DBDI::DriverManager');
+isa_ok($conn, DBDI::Driver::SQLite3);
 my $stm = $conn.createStatement();
-### isa_ok($stm, 'DBDI::Statement');
+isa_ok($stm, DBDI::Statement);
 my $rs = $stm.executeUpdate("CREATE TABLE foo (bar, baz)");
 ### ok( $rs->success, 'Created foo OK');
 ### I'd also add a test that a SELECT works and returns 0 rows
 
 my $stm = $conn.prepareStatement("INSERT INTO foo (bar, baz) VALUES (?, ?)");
-### isa_ok( $stm, 'DBDI::PreparedStatement');
+isa_ok( $stm, DBDI::PreparedStatement);
 $stm.bind(1, 123);
 $stm.bind(2, "Thingy");
 $stm.executeUpdate();
@@ -23,9 +23,9 @@
 my $stm2 = $conn.createStatement();
 my $rs = $stm2.executeQuery("SELECT baz, bar FROM foo");
 while ($rs.next()) {
-    if (($rs.getCol(1) eq "Thingy") && ($rs.getCol("baz") = 123)) {
-        ok(1, 'select equals insert');
-    }
+    ok(($rs.getCol("baz") eq "Thingy"), "baz == Thingy");
+    ok(($rs.getCol(1) = 123), "col1 == 123");
+    #say $rs.getCol("bas"); #segfaults
 }
 
 # vim: ft=perl6:

Reply via email to