[clang] [libclang/python] Improve test coverage (PR #109846)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 24 14:14:41 PDT 2024


================
@@ -279,6 +280,90 @@ def test_is_default_method(self):
         self.assertTrue(xc.is_default_method())
         self.assertFalse(yc.is_default_method())
 
+    def test_is_deleted_method(self):
+        source = "class X { X() = delete; }; class Y { Y(); };"
+        tu = get_tu(source, lang="cpp")
+
+        xs = get_cursors(tu, "X")
+        ys = get_cursors(tu, "Y")
+
+        self.assertEqual(len(xs), 2)
+        self.assertEqual(len(ys), 2)
+
+        xc = xs[1]
+        yc = ys[1]
+
+        self.assertTrue(xc.is_deleted_method())
+        self.assertFalse(yc.is_deleted_method())
+
+    def test_is_copy_assignment_operator_method(self):
----------------
Endilll wrote:

Hm, so cursor goes over source representation of the code rather than semantics? Fine then.

https://github.com/llvm/llvm-project/pull/109846


More information about the cfe-commits mailing list