mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Pair and Triple Compare w/ Unit Tests (#2359)
* Pair and Triple Compare w/ Unit Tests * scope creep myself by adding date-time eq op * make Pair and Triple printable * Update releasenotes. Restrict equals on tuples to when underlying type supports `==`. Remove unnecessary Time.eq. --------- Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
This commit is contained in:
@@ -13,6 +13,20 @@ fn void time_diff()
|
||||
test::eq(t, t2);
|
||||
}
|
||||
|
||||
fn void time_eq()
|
||||
{
|
||||
Time t = time::now();
|
||||
Time t2 = t;
|
||||
|
||||
assert(t == t2);
|
||||
|
||||
t2 += time::US;
|
||||
assert(t != t2);
|
||||
|
||||
t2 -= time::US;
|
||||
assert(t == t2);
|
||||
}
|
||||
|
||||
fn void clock_diff()
|
||||
{
|
||||
Clock c = clock::now();
|
||||
|
||||
Reference in New Issue
Block a user