Skip to content

Commit

Permalink
Move equality-key-expression test into test file
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKnauth committed Feb 7, 2023
1 parent 7a1ad75 commit 4026df5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 0 additions & 8 deletions rhombus/data/equality.rhm
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,3 @@ class_clause.macro 'equality: $key_expr; ...':
...
code'


class Foo(a, b, c):
equality:
a
b + c

Foo(1, 5, 10) == Foo(1, 10, 5) // true
Foo(1, 5, 10) == Foo(1, 5, 5) // false
9 changes: 9 additions & 0 deletions rhombus/tests/equatable.rhm
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,12 @@ check: OrderedTriple("A", "B", "C") == OrderedTriple2("A", "B", "C") ~is #false
check: hc(OrderedTriple("A", "B", "C")) == hc(OrderedTriple2("A", "B", "C"))
~is #false
check: {OrderedTriple("A", "B", "C"), OrderedTriple2("A", "B", "C")}.length() ~is 2

class Foo(a, b, c):
equality:
a
b + c

check: Foo(1, 5, 10) == Foo(1, 10, 5) ~is #true
check: Foo(1, 5, 10) == Foo(1, 5, 5) ~is #false

0 comments on commit 4026df5

Please sign in to comment.