[clang] [libclang/python] Improve test coverage (PR #109846)
Jannick Kremer via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 24 14:12:52 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):
----------------
DeinAlptraum wrote:
How do you mean exactly? If I have a class inherit a copy-assignment operator, there is no function declaration cursor for that class to call `is_copy_assignment_operator_method` on.
https://github.com/llvm/llvm-project/pull/109846
More information about the cfe-commits
mailing list