From 0fe5fdc166b98d5b283d70fd4d3a80d3f852da42 Mon Sep 17 00:00:00 2001
From: Ankith <itsankith26@gmail.com>
Date: Mon, 7 Oct 2024 01:51:58 +0530
Subject: [PATCH] Add basic pygame.typing unit test

---
 test/meson.build    |  1 +
 test/typing_test.py | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 test/typing_test.py

diff --git a/test/meson.build b/test/meson.build
index 2ef78899bf..d789ad01e0 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -50,6 +50,7 @@ test_files = files(
     'time_test.py',
     'touch_test.py',
     'transform_test.py',
+    'typing_test.py',
     'version_test.py',
     'video_test.py',
     'window_test.py',
diff --git a/test/typing_test.py b/test/typing_test.py
new file mode 100644
index 0000000000..46fd4d29c3
--- /dev/null
+++ b/test/typing_test.py
@@ -0,0 +1,26 @@
+import unittest
+
+# A basic unit test to test that pygame.typing can import in python code, and
+# the documented attributes are accessible.
+# More rigorous testing needs mypy and is therefore implemented in the stubs
+# directory.
+TYPING_PUBLIC_ATTRS = [
+    "RectLike",
+    "SequenceLike",
+    "FileLike",
+    "ColorLike",
+    "Point",
+    "IntPoint",
+]
+
+
+class TypingTest(unittest.TestCase):
+    def test_typing_has_attrs(self):
+        import pygame.typing
+
+        for i in TYPING_PUBLIC_ATTRS:
+            self.assertTrue(hasattr(pygame.typing, i))
+
+
+if __name__ == "__main__":
+    unittest.main()