feat(definitions): add expectations for test lines (#1257)

* factor out test helpers

* refactor, add tests for animebytes

* revert test refactor

* better name

* change format, migrate some examples

* migrated remaining test cases

* add comment about `Test` vs `Tests`

* refactor

* reorder expectations to match vars

* generate

* turn on strict unmarshalling, remove old `Test` from schema

* start modifying actual definitions

* done with the As

* Bs

* C, D

* E, F

* G, H, I, ... L

* M, N

* O, P

* R

* bonus error. without this, pattern/vars disagreement can panic.

* S

* T, U

* X.. Now we know our ABCs next time won't you sing with meeeee

* fix another test

* another driveby change

* be less strict parsing custom definitions

* fix(definitions): load custom definitions

---------

Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
Frederick Robinson 2023-11-18 06:41:39 -08:00 committed by GitHub
parent e842a7bd42
commit fef0da5711
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
83 changed files with 1887 additions and 565 deletions

View file

@ -12,7 +12,7 @@ supports:
- irc
- rss
- api
source: gazelle
# source: gazelle
settings:
- name: authkey
type: secret
@ -32,17 +32,17 @@ settings:
label: API Key
help: Username -> Edit / Settings -> API Keys
api:
url: https://gazellegames.net/api.php
type: json
limits:
max: 5
per: 10 seconds
settings:
- name: api_key
type: secret
label: API Key
help: Username -> Edit / Settings -> API Keys
# api:
# url: https://gazellegames.net/api.php
# type: json
# limits:
# max: 5
# per: 10 seconds
# settings:
# - name: api_key
# type: secret
# label: API Key
# help: Username -> Edit / Settings -> API Keys
irc:
network: GGn
@ -82,9 +82,29 @@ irc:
parse:
type: single
lines:
- test:
- "Uploader :-: Nintendo 3DS :-: Cool.Game.KOR.3DS-BigBlueBox in Cool Game [2013] ::Korean, Multi-Region, Scene:: https://gazellegames.net/torrents.php?torrentid=00000 - adventure, role_playing_game, nintendo;"
- "Uploader :-: Windows :-: Other.Game-HI2U in Other Game [2016] ::English, Scene:: FREELEECH! :: https://gazellegames.net/torrents.php?torrentid=00000 - action, adventure, casual, indie, role.playing.game;"
- tests:
- line: 'Uploader :-: Nintendo 3DS :-: Cool.Game.KOR.3DS-BigBlueBox in Cool Game [2013] ::Korean, Multi-Region, Scene:: https://gazellegames.net/torrents.php?torrentid=00000 - adventure, role_playing_game, nintendo;'
expect:
uploader: Uploader
category: Nintendo 3DS
torrentName: Cool.Game.KOR.3DS-BigBlueBox in Cool Game
year: "2013"
releaseTags: Korean, Multi-Region, Scene
freeleech: ""
baseUrl: https://gazellegames.net/
torrentId: "00000"
tags: adventure, role_playing_game, nintendo
- line: 'Uploader :-: Windows :-: Other.Game-HI2U in Other Game [2016] ::English, Scene:: FREELEECH! :: https://gazellegames.net/torrents.php?torrentid=00000 - action, adventure, casual, indie, role.playing.game;'
expect:
uploader: Uploader
category: Windows
torrentName: Other.Game-HI2U in Other Game
year: "2016"
releaseTags: English, Scene
freeleech: FREELEECH
baseUrl: https://gazellegames.net/
torrentId: "00000"
tags: action, adventure, casual, indie, role.playing.game
pattern: '^(.+) :-: (.+) :-: (.+) \[(\d+)?\] ::(.+?)?:: ?(.+?)?(?:! ::)? (https?:\/\/[^\/]+\/)torrents.php\?torrentid=(\d+)(?: - )?([a-zA-Z0-9, _\.]+)?;?(?:[ :]*(?:[NSFW]*)?[! :]*)?$'
vars:
- uploader