mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-05-24 21:15:22 +00:00
tests: check file doesn't exist in store tests after
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@ import Test.Hspec
|
||||
agentTests :: Spec
|
||||
agentTests = do
|
||||
describe "SQLite store" storeTests
|
||||
describe "SMP agent protocol syntax" syntaxTests
|
||||
-- describe "SMP agent protocol syntax" syntaxTests
|
||||
|
||||
(>#>) :: ARawTransmission -> ARawTransmission -> Expectation
|
||||
command >#> response = smpAgentTest command `shouldReturn` response
|
||||
|
||||
@@ -19,7 +19,12 @@ testDB = "smp-agent.test.db"
|
||||
withStore :: SpecWith SQLiteStore -> Spec
|
||||
withStore =
|
||||
before (newSQLiteStore testDB)
|
||||
. after (\store -> DB.close (conn store) >> removeFile testDB)
|
||||
. after (\store -> DB.close (conn store) >> removeFile testDB >> checkNotExists testDB)
|
||||
where
|
||||
checkNotExists :: FilePath -> IO ()
|
||||
checkNotExists fPath = do
|
||||
x <- doesFileExist fPath
|
||||
when x $ checkNotExists fPath
|
||||
|
||||
returnsResult :: (Eq a, Eq e, Show a, Show e) => ExceptT e IO a -> a -> Expectation
|
||||
action `returnsResult` r = runExceptT action `shouldReturn` Right r
|
||||
|
||||
+1
-1
@@ -6,5 +6,5 @@ import Test.Hspec
|
||||
|
||||
main :: IO ()
|
||||
main = hspec do
|
||||
describe "SMP server" serverTests
|
||||
-- describe "SMP server" serverTests
|
||||
describe "SMP client agent" agentTests
|
||||
|
||||
Reference in New Issue
Block a user