neilpa / Equality

Generic equality operator for SequenceType

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Equality

Defines ad-hoc equality operators for arbitrary SequenceTypes of Equatable elements of the same type. Seqeunces are considered equivalent iff they contain the same number of elements in the same order.

Usage

In practice this is most useful when testing custom collections against some reference collection (e.g. an array).

import Equality

let seq = CustomSequence(1, 2, 3)
assert(seq == [1, 2, 3])

About

Generic equality operator for SequenceType

License:MIT License


Languages

Language:Swift 94.9%Language:C++ 5.1%