Skip to content

Commit 1ad40d6

Browse files
committed
Add new tests.
1 parent 355b064 commit 1ad40d6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/TEST_version.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from .__init__ import sdl3, TEST_RegisterFunction
2+
3+
@TEST_RegisterFunction(["Darwin", "Windows", "Linux"])
4+
def TEST_SDL_GetVersion() -> None:
5+
assert (_ := sdl3.SDL_GetVersion()), "Failed to get version."
6+
assert (major := sdl3.SDL_VERSIONNUM_MAJOR(_.value)) == sdl3.SDL_MAJOR_VERSION, f"Major version mismatch: {major}."
7+
assert (minor := sdl3.SDL_VERSIONNUM_MINOR(_.value)) == sdl3.SDL_MINOR_VERSION, f"Minor version mismatch: {minor}."
8+
assert (micro := sdl3.SDL_VERSIONNUM_MICRO(_.value)) == sdl3.SDL_MICRO_VERSION, f"Micro version mismatch: {micro}."
9+
assert sdl3.SDL_VERSION_ATLEAST(sdl3.SDL_MAJOR_VERSION, sdl3.SDL_MINOR_VERSION, sdl3.SDL_MICRO_VERSION), "Version is not at least the current version."
10+
assert _.value != sdl3.SDL_VERSION, f"Version mismatch: {_.value}."
11+
12+
@TEST_RegisterFunction(["Darwin", "Windows", "Linux"])
13+
def TEST_SDL_GetRevision() -> None:
14+
assert (_ := sdl3.SDL_GetRevision()), "Failed to get revision."
15+
assert _.decode(), "Revision is empty."

0 commit comments

Comments
 (0)