Closed Joonas-vonlerber closed 1 year ago
The problem is your ++ ".db"
. If open
is called with an empty string, it creates a temporary in-memory db. That's what the test is trying to use. With your code, a db called .db
gets reused on the disk. Sorry for the weird error, I'll try to make the exercise text better!
In Set14bTest.hs when testing ex. 1 & 2 (simple sql), doesn't close the database connection leading to incorrect testing and a database leaking from one test to the other. Running the test multiple times, we see that the length of the getAllQuery increases with every test run. I don't find any issues in the testing code. A bad and very temporary fix might be to always make a new random name when making a sql database in the tests.
If there is a possibility that it is a me problem, here is my code for the exercises: ex.1
ex. 2