Audit

net.gfxmonk.auditspec.Audit$
See theAudit companion class
object Audit

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Audit.type

Members list

Concise view

Value members

Concrete methods

def apply[F[_], T](implicit io: Concurrent[F]): F[Audit[F, T]]
def partitionAndSort[T](events: List[T], expected: List[List[T]])(implicit ordering: Ordering[T]): (List[List[T]], List[List[T]])

Utility function for partially ordered results. For example, you might have an interaction where you know that A and B events will happen concurrently, but they'll both occur before C and D. Because A/B and C/D are concurrent, you may get any of:

Utility function for partially ordered results. For example, you might have an interaction where you know that A and B events will happen concurrently, but they'll both occur before C and D. Because A/B and C/D are concurrent, you may get any of:

  • List(A, B, C, D)
  • List(B, A, C, D)
  • List(A, B, D, C)
  • List(B, A, C, D)

But that's awkward to match against, and you don't want to just discard ordering.

In this case you could use: val (actual, expected) = partitionAndSort(eventList, List(List(A, B), List(C, D))) assert(actual == expected)

Each chunk will be sorted (to remove concurrent ordering issues), but the order of chunks will be preserved.

Attributes

def resource[F[_], T](implicit io: Concurrent[F]): Resource[F, Audit[F, T]]