Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Test revDescription more thoroughly #3

Merged
merged 1 commit into from

2 participants

@bmillwood

I recently had a problem that I traced to filestore retrieving commit descriptions from git log incorrectly – but all the tests passed. So, in addition to testing that the description is non-empty, it would be helpful to test that it is actually the description of the most recent commit.

@bmillwood

(I'm yet to work out the bug that made me want this test; it depends on the system I use and might well be my mistake. But the test is useful regardless of what happens to that).

@jgm jgm merged commit 34d06ac into from
@jgm
Owner

Thanks - better tests are always good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 25, 2012
  1. @bmillwood
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 tests/Tests.lhs
View
4 tests/Tests.lhs
@@ -306,6 +306,8 @@ This program runs tests for the filestore modules.
*** Test history and revision
> historyTest fs = TestCase $ do
+> let testDescription = "history test message"
+> save fs testTitle testAuthor testDescription testContents
Get history for three files
@@ -316,7 +318,7 @@ This program runs tests for the filestore modules.
> assertBool "history contains latest revision" (rev `elem` hist)
> assertEqual "revAuthor" testAuthor (revAuthor rev)
> assertBool "revId non-null" (not (null (revId rev)))
-> assertBool "revDescription non-null" (not (null (revDescription rev)))
+> assertEqual "revDescription" testDescription (revDescription rev)
> assertEqual "revChanges" [Modified testTitle] (revChanges rev)
> let revtime = revDateTime rev
> histNow <- history fs [testTitle] (TimeRange (Just $ addUTCTime (60 * 60 * 24) now) Nothing) Nothing
Something went wrong with that request. Please try again.