Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Commit

Permalink
test tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
galiri committed May 8, 2017
1 parent 1b06a8a commit 1746d02
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions native/mongo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,17 @@ func TestFindUUIDsDateSort(t *testing.T) {
iter, count, err := tx.FindUUIDs("methode", 0, 10)
assert.NoError(t, err)
assert.NotEqual(t, 0, count)
i := 0
found := false
actualUUIDs := []string{}
for !iter.Done() {
found = false
result := map[string]interface{}{}
iter.Next(&result)
val, ok := result["uuid"]
actualUUIDs = append(actualUUIDs, parseBinaryUUID(val))
if !ok {
continue
}
if parseBinaryUUID(val) == testUUIDs[i] {
t.Log("actual " + parseBinaryUUID(val) + " expected " + testUUIDs[i])
found = true
}
i++
assert.True(t, found, "uuids do not match therefore they are not in expected descending date order")
}
assert.Equal(t, testUUIDs, actualUUIDs, "uuids do not match therefore they are not in expected descending date order")

cleanupTestContent(t, db, testUUIDs...)
}
Expand Down

0 comments on commit 1746d02

Please sign in to comment.