feat: Add best effort test to validate game ID rules (#111)

* [Test] Add best effort test to validate game ID rules

An attempt to implement the rules specified in #108 as a programmatic
test.

* [Test] Refactor ID rules to check if a mod exists after - in game name

This allows fivem to pass the check following rule 8, but could also
cause a false pass in some cases.

* [Test] Add unit tests for ID rule checker

Adds unit tests based on the examples in CONTRIBUTING.md to confirm in
those cases we would allow ID to pass. However these tests don't check
any error cases.

* test/id: Correctly extract protocol names

* games/defs: Fix unreal tournament IDs

* tests: Require game definitions to run ID tests

* tests: Improve comments on ID tests

* tests/id: Combine - seperated numbers

* games/defs: Fix darkest hour ID

* Add/Update badge

---------

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Tom 2023-12-19 21:20:19 +00:00 committed by GitHub
parent 10169c9107
commit 87ed02420e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 570 additions and 7 deletions

View file

@ -29,6 +29,9 @@ Game:
- - Left 4 Dead: `left4dead` -> `l4d`.
- - 7 Days to Die: `7d2d` in definitions and `sd2d` in game declaration -> `sdtd`.
- - Quake 3 Arena: `quake3arena` -> `q3a`.
- - Unreal tournament 2003: `ut2003` -> `unrealtournament2003`
- - Unreal tournament 2004: `ut2004` -> `unrealtournament2004`
- - Darkest Hour: Europe '44-'45: `darkesthour` -> `dhe4445`
- Minecraft:
- - Legacy 1.5 and 1.3 were renamed to 1.4 and beta 1.8 respectively to show the lowest version they support, this change includes Structs, Enum and game id renames, also removed the "v" from the game definition name.
- - Moved the Minecraft protocol implementation in the games folder as its proprietary.