From 4f8c9f8828abb1f86af5ac40063a6f6252403298 Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni Date: Thu, 10 Mar 2022 16:09:01 -0600 Subject: [PATCH] tests whether obj tagged can be persistent hashed --- test/test_loopy.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/test_loopy.py b/test/test_loopy.py index 10171ef6e..c0eeea3b1 100644 --- a/test/test_loopy.py +++ b/test/test_loopy.py @@ -3263,6 +3263,20 @@ def test_redn_in_predicate(ctx_factory): lp.auto_test_vs_ref(knl, ctx, knl) +def test_obj_tagged_is_persistent_hashable(): + from loopy.tools import LoopyKeyBuilder + from pytools.tag import tag_dataclass, Tag + from loopy.match import ObjTagged + + lkb = LoopyKeyBuilder() + + @tag_dataclass + class MyTag(Tag): + pass + + assert lkb(ObjTagged(MyTag())) == lkb(ObjTagged(MyTag())) + + if __name__ == "__main__": if len(sys.argv) > 1: exec(sys.argv[1]) -- GitLab