Skip to content

Commit

Permalink
Restore tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MyreMylar authored Dec 31, 2024
1 parent 459c4bb commit 614e954
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/event_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ def test_clear(self):
self.assertRaises(TypeError, pygame.event.get, ["a", "b", "c"])

def test_peek(self):
pygame.event.peek()
pygame.event.peek(None)
pygame.event.peek(None, True)

pygame.event.peek(pump=False)
pygame.event.peek(pump=True)
pygame.event.peek(eventtype=None)
pygame.event.peek(eventtype=[pygame.KEYUP, pygame.KEYDOWN])
pygame.event.peek(eventtype=pygame.USEREVENT, pump=False)

Expand Down Expand Up @@ -754,6 +761,11 @@ def test_peek__empty_queue(self):
"""Ensure peek() works correctly on an empty queue."""
pygame.event.clear()

# Ensure all events can be checked.
peeked = pygame.event.peek()

self.assertFalse(peeked)

# Ensure events can be checked individually.
for event_type in EVENT_TYPES:
peeked = pygame.event.peek(event_type)
Expand Down

0 comments on commit 614e954

Please sign in to comment.