@@ -83,6 +83,7 @@ doit root
8383 unless (db1 == db2) $ die " Databases don't match"
8484 info " Checking server still works, and data is intact"
8585 withServerRunning root runPackageTests
86+ withServerRunning root runRevisionTests
8687
8788
8889runUserTests :: IO ()
@@ -191,6 +192,23 @@ runPackageUploadTests = do
191192 uploadTimeISO = " 2010-10-18T20:54:28Z"
192193 uploadTimeISO2 = " 2020-10-18T20:54:28Z"
193194
195+ runRevisionTests :: IO ()
196+ runRevisionTests = do
197+ do info " Revising testpackage"
198+ post (Auth " HackageTestUser1" " testpass1" ) " /package/testpackage-1.0.0.0/testpackage.cabal/edit"
199+ [ (" cabalfile" , revisedCabalFileContent)
200+ , (" publish" , " Publish new revision" )
201+ ]
202+ do info " Checking revision exists"
203+ xs <- getUrl NoAuth " /package/testpackage-1.0.0.0/revision/1.cabal"
204+ unless (xs == revisedCabalFileContent) $
205+ die " Bad revised cabal file content"
206+ where
207+ (_, _, _, testpackageCabalFileContent, _, _) = testpackage
208+ revisedCabalFileContent =
209+ " x-revision: 1\n description: a description added by revision\n "
210+ ++ testpackageCabalFileContent
211+
194212runPackageTests :: IO ()
195213runPackageTests = do
196214 do info " Getting package list"
0 commit comments