Index: Setup/verify.lst ================================================================== --- Setup/verify.lst +++ Setup/verify.lst @@ -636,10 +636,11 @@ Tests/tkt-ae5267b863.eagle Tests/tkt-b4a7ddc83f.eagle Tests/tkt-bb4b04d457.eagle Tests/tkt-c010fa6584.eagle Tests/tkt-ccfa69fc32.eagle + Tests/tkt-d0116ee2c3.eagle Tests/tkt-e06c4caff3.eagle Tests/tkt-e1b2e0f769.eagle Tests/tkt-e30b820248.eagle Tests/tkt-e47b3d8346.eagle Tests/tkt-ef2216192d.eagle ADDED Tests/tkt-d0116ee2c3.eagle Index: Tests/tkt-d0116ee2c3.eagle ================================================================== --- /dev/null +++ Tests/tkt-d0116ee2c3.eagle @@ -0,0 +1,82 @@ +############################################################################### +# +# tkt-d0116ee2c3.eagle -- +# +# Written by Joe Mistachkin. +# Released to the public domain, use at your own risk! +# +############################################################################### + +package require Eagle +package require Eagle.Library +package require Eagle.Test + +runTestPrologue + +############################################################################### + +package require System.Data.SQLite.Test +runSQLiteTestPrologue + +############################################################################### + +runTest {test tkt-d0116ee2c3-1.1 {setting Connection property} -setup { + setupDb [set fileName tkt-d0116ee2c3-1.1.db] +} -body { + sql execute $db { + CREATE TABLE t1(x); + INSERT INTO t1 (x) VALUES(1); + } + + set id [object invoke Interpreter.GetActive NextId] + set dataSource [file join [getDatabaseDirectory] $fileName] + + unset -nocomplain results errors + + set code [compileCSharpWith [subst { + using System.Data.SQLite; + + namespace _Dynamic${id} + { + public static class Test${id} + { + public static void Main() + { + using (SQLiteConnection connection = new SQLiteConnection( + "Data Source=${dataSource};[getFlagsProperty]")) + { + connection.Open(); + + using (SQLiteCommand command = connection.CreateCommand()) + { + command.CommandText = "SELECT x FROM t1;"; + + using (SQLiteDataReader dataReader = command.ExecuteReader()) + { + dataReader.Close(); + command.Connection = null; /* InvalidOperationException? */ + } + } + } + } + } + } + }] true true true results errors System.Data.SQLite.dll] + + list $code $results \ + [expr {[info exists errors] ? $errors : ""}] \ + [expr {$code eq "Ok" ? [catch { + object invoke _Dynamic${id}.Test${id} Main + } result] : [set result ""]}] $result +} -cleanup { + cleanupDb $fileName + + unset -nocomplain result results errors code dataSource id db fileName +} -constraints {eagle monoBug28 command.sql compile.DATA SQLite\ +System.Data.SQLite compileCSharp} -match regexp -result {^Ok\ +System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{\}$}} + +############################################################################### + +runSQLiteTestEpilogue +runTestEpilogue