Hi,

I looked at the tests to learn something about scheme and the postgresql 
interface.

The following does not look good:

  (test-assert "reset-connection returns a connection"
               (let* ((conn (connect '((dbname . test))))
                      (isconn (connection? conn)))
                 (reset-connection conn)
                 (disconnect conn)
                 isconn))
  (test-error "disconnect invalidates the connection"
              (let ((conn (connect '((dbname . test)))))
                (disconnect conn)
                (reset-connection conn)))

I suppose in the first test you want to test if the connection is still alive 
after
reset-connection, but you only test after connect. Proposed changes: replace 
test
last line isconn with (connection? conn)

In the second test the return value is from reset-connection, which is problably
void. Proposed change: replace (reset-connection conn) with (connection? conn).
Then you will notice that the test fails.

I checked this in the REPL: after (disconnect conn) I still got true for 
(connection?
conn) but was not able to use it for queries.

Terminal-Log to this problem:

#;11> (disconnect conn)
#;12> (connection? conn)
#t
#;13> (value-at (query conn "select -101 as cnt"))

Error: (query*) Unable to send query to server. connection pointer is NULL

/Str.


_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to