================
@@ -10,26 +10,6 @@
 
 
 class TestTokenKind(unittest.TestCase):
-    def test_constructor(self):
----------------
DeinAlptraum wrote:

So the existing "custom" enum implementation included a sort of constructor, as 
we see in this test, that takes a number and name and then adds that as a new 
variant to the existing enum. No such constructor exists for the builtin `Enum` 
class, so there isn't really an equivalent for this test under the new 
implementation.
We could test that it is impossible for the user to add their own variants 
dynamically at runtime by doing something like `TokenKind.NEW_VARIANT = 6`, but 
that doesn't really seem like our problem, and was also possible under the old 
implementation

Your comment did however raise another question for me: while we've covered 
that there are no duplicate names with different IDs, we haven't covered that 
there are no duplicate IDs with different names, and this is indeed possible in 
the enum class, and not covered by our current tests so I just added one.

https://github.com/llvm/llvm-project/pull/95608
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to