From 785502b9049858b9d449ee63e7bf556661f6849a Mon Sep 17 00:00:00 2001
From: Justin Carpentier <justin.carpentier@inria.fr>
Date: Mon, 10 Jun 2024 12:27:03 +0200
Subject: [PATCH] test: add test of id helper

---
 unittest/CMakeLists.txt    |  1 +
 unittest/python/test_id.py | 11 +++++++++++
 2 files changed, 12 insertions(+)
 create mode 100644 unittest/python/test_id.py

diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt
index 72bfb1bb..4453547a 100644
--- a/unittest/CMakeLists.txt
+++ b/unittest/CMakeLists.txt
@@ -113,6 +113,7 @@ add_python_lib_unit_test("py-deprecation-policy"
 add_python_lib_unit_test("py-return-by-ref"
                          "unittest/python/test_return_by_ref.py")
 add_python_lib_unit_test("py-eigen-ref" "unittest/python/test_eigen_ref.py")
+add_python_lib_unit_test("py-id" "unittest/python/test_id.py")
 
 if(NOT NUMPY_WITH_BROKEN_UFUNC_SUPPORT)
   add_python_lib_unit_test("py-user-type" "unittest/python/test_user_type.py")
diff --git a/unittest/python/test_id.py b/unittest/python/test_id.py
new file mode 100644
index 00000000..c6d87bb5
--- /dev/null
+++ b/unittest/python/test_id.py
@@ -0,0 +1,11 @@
+import eigenpy
+
+ldlt1 = eigenpy.LDLT()
+ldlt2 = eigenpy.LDLT()
+
+id1 = ldlt1.id()
+id2 = ldlt2.id()
+
+assert id1 != id2
+assert id1 == ldlt1.id()
+assert id2 == ldlt2.id()
-- 
GitLab