diff options
| author | Jamis Buck <jamis@37signals.com> | 2007-01-13 19:09:14 +0000 |
|---|---|---|
| committer | Jamis Buck <jamis@37signals.com> | 2007-01-13 19:09:14 +0000 |
| commit | 12953284d8a3e171c9a029ab11a47167df304b55 (patch) | |
| tree | bc9ecd2f145e1af8003ec4b80cd21adbfa13f91b | |
| parent | 9f39984c8f2b5b4ff4d64824f92247c69d58f0a6 (diff) | |
| download | third_party-sqlite3-ruby-12953284d8a3e171c9a029ab11a47167df304b55.tar.gz third_party-sqlite3-ruby-12953284d8a3e171c9a029ab11a47167df304b55.tar.xz third_party-sqlite3-ruby-12953284d8a3e171c9a029ab11a47167df304b55.zip | |
Add a test to ensure that bug #2045 is no longer an issue
| -rw-r--r-- | test/tc_integration.rb | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/test/tc_integration.rb b/test/tc_integration.rb index 74b18c8..664d216 100644 --- a/test/tc_integration.rb +++ b/test/tc_integration.rb @@ -1,5 +1,5 @@ -$:.unshift "../lib" -$:.unshift "../ext/sqlite3_api" +$:.unshift "#{File.dirname(__FILE__)}/../lib" +$:.unshift "#{File.dirname(__FILE__)}/../ext/sqlite3_api" require 'test/unit' require 'benchmark' @@ -84,10 +84,10 @@ module Integration assert @db.complete?( "select * from foo;" ) end -# FIXME: this test is failing with sqlite3 3.2.5 -# define_method( "test_complete_fail_utf16" ) do -# assert !@db.complete?( "select * from foo".to_utf16(false), true ) -# end + define_method( "test_complete_fail_utf16" ) do + assert !@db.complete?( "select * from foo".to_utf16(false), true ) + end + define_method( "test_complete_success_utf16" ) do assert @db.complete?( "select * from foo;".to_utf16(true), true ) end @@ -820,6 +820,20 @@ module Integration assert_raise( SQLite3::Exception ) { stmt.columns } assert_raise( SQLite3::Exception ) { stmt.types } end + + define_method( "test_committing_tx_with_statement_active" ) do + called = false + @db.prepare( "select count(*) from foo" ) do |stmt| + called = true + count = stmt.execute!.first.first.to_i + @db.transaction do + @db.execute "insert into foo ( b ) values ( 'hello' )" + end + new_count = stmt.execute!.first.first.to_i + assert_equal new_count, count+1 + end + assert called + end end const_set( "TC_Statement_#{driver}", test_case ) |
