diff options
| author | mergify[bot] | 2023-01-12 00:04:06 +0000 |
|---|---|---|
| committer | GitHub | 2023-01-12 00:04:06 +0000 |
| commit | 6a63353f2a6c3311e61b9a7b5b899d8ad904a86d (patch) | |
| tree | b34e0dbe0bc1719a144586728cafd9ed59a31e1d /src/test/scala/chiselTests/util | |
| parent | d4570fb9d29371c35641ba79b76662f99677f192 (diff) | |
TruthTable improvements: structural equality and delete sort (backport #2935) (#2936)
* TruthTable improvements: structural equality and delete sort (#2935)
We had implemented equals, but not hashCode. This commit also changes
the implemental of equals to just use the underlying values instead of
wasting the compute calling .toString.
Delete TruthTable.sort, it is unused.
(cherry picked from commit b5d9c08b2d0994b94df2380425282206fe1f25bc)
* Restore and deprecate TruthTable.sort
Co-authored-by: Jack Koenig <koenig@sifive.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Diffstat (limited to 'src/test/scala/chiselTests/util')
| -rw-r--r-- | src/test/scala/chiselTests/util/experimental/TruthTableSpec.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/scala/chiselTests/util/experimental/TruthTableSpec.scala b/src/test/scala/chiselTests/util/experimental/TruthTableSpec.scala index 9b2dd600..b5dcee6b 100644 --- a/src/test/scala/chiselTests/util/experimental/TruthTableSpec.scala +++ b/src/test/scala/chiselTests/util/experimental/TruthTableSpec.scala @@ -35,7 +35,9 @@ class TruthTableSpec extends AnyFlatSpec { assert(table.toString contains " 0") } "TruthTable" should "deserialize" in { - assert(TruthTable.fromString(str) == table) + val table2 = TruthTable.fromString(str) + assert(table2 === table) + assert(table2.hashCode === table.hashCode) } "TruthTable" should "merge same key" in { assert( |
