Improve error raising and add initial tests
This commit is contained in:
parent
f3fabf2d8a
commit
dbd93e4956
22 changed files with 268 additions and 55 deletions
1
test/description/error_1_nested_url_tag.txt
Normal file
1
test/description/error_1_nested_url_tag.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
[url=https://example.com]Nested [url=https://example.net]URLs[/url][/url]
|
||||
1
test/description/error_2_deeply_nested_b_tag.txt
Normal file
1
test/description/error_2_deeply_nested_b_tag.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
ZERO[b]ONE[i]TWO[u]THREE[b]FOUR[url=https://example.com]FIVE[/url]FOUR[/b]THREE[/u]TWO[/i]ONE[/b]ZERO
|
||||
1
test/description/error_3_unclosed_i_tag.txt
Normal file
1
test/description/error_3_unclosed_i_tag.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
[i]Hello world!
|
||||
1
test/description/error_4_unopened_u_tag.txt
Normal file
1
test/description/error_4_unopened_u_tag.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
Hello world![/u]
|
||||
1
test/description/error_5_unknown_user_tag.txt
Normal file
1
test/description/error_5_unknown_user_tag.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
[user][unknown=Foo]Bar[/unknown][/user]
|
||||
9
test/description/input_1.txt
Normal file
9
test/description/input_1.txt
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[b]Hello world![/b]
|
||||
|
||||
This is just a [u]simple[/u] test to show that basic functionality of [url=https://github.com/BadMannersXYZ/upload-generator]upload-generator[/url] [i]works[/i]. [if=define==test_parse_description]And this is running in a unit test.[/if][else]Why did you parse this outside of a unit test?![/else]
|
||||
|
||||
Reminder that I am [self][/self]!
|
||||
|
||||
My friend: [user][sofurry=FriendSoFurry][fa=FriendFa][mastodon=@FriendMastodon@example.org]Friend123[/mastodon][/fa][/sofurry][/user][if=site in ib,aryion,weasyl] (I dunno his account here...)[/if]
|
||||
|
||||
[siteurl][eka=https://example.com/eka][inkbunny=https://example.com/ib][generic=https://example.com/generic]Check this page![/generic][/inkbunny][/eka][/siteurl]
|
||||
12
test/description/input_2.txt
Normal file
12
test/description/input_2.txt
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[self][/self]
|
||||
|
||||
[if=site==eka] -> [/if][user][eka=EkaPerson]EkaName[/eka][/user] [user][eka]EkaPerson[/eka][/user]
|
||||
[if=site==fa] -> [/if][user][fa=FaPerson]FaName[/fa][/user] [user][fa]FaPerson[/fa][/user]
|
||||
[if=site==ib] -> [/if][user][ib=IbPerson]IbName[/ib][/user] [user][ib]IbPerson[/ib][/user]
|
||||
[if=site==sofurry] -> [/if][user][sf=SfPerson]SfName[/sf][/user] [user][sf]SfPerson[/sf][/user]
|
||||
[if=site==weasyl] -> [/if][user][weasyl=WeasylPerson]WeasylName[/weasyl][/user] [user][weasyl]WeasylPerson[/weasyl][/user]
|
||||
[user][twitter=XPerson]XName[/twitter][/user] [user][twitter]XPerson[/twitter][/user]
|
||||
[user][mastodon=MastodonPerson@example.com]MastodonName[/mastodon][/user] [user][mastodon]MastodonPerson@example.com[/mastodon][/user]
|
||||
[user][twitter=Ignored][generic=https://example.net/GenericPerson]GenericName[/generic][/twitter][/user]
|
||||
|
||||
[siteurl][aryion=https://example.com/aryion][furaffinity=https://example.com/furaffinity][inkbunny=https://example.com/inkbunny][sofurry=https://example.com/sofurry][generic=https://example.com/generic]Link[/generic][/sofurry][/inkbunny][/furaffinity][/aryion][/siteurl]
|
||||
9
test/description/output_1/desc_aryion.txt
Normal file
9
test/description/output_1/desc_aryion.txt
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[b]Hello world![/b]
|
||||
|
||||
This is just a [u]simple[/u] test to show that basic functionality of [url=https://github.com/BadMannersXYZ/upload-generator]upload-generator[/url] [i]works[/i]. And this is running in a unit test.
|
||||
|
||||
Reminder that I am :iconUserAryion:!
|
||||
|
||||
My friend: [url=https://example.org/@FriendMastodon]Friend123[/url] (I dunno his account here...)
|
||||
|
||||
[url=https://example.com/eka]Check this page![/url]
|
||||
9
test/description/output_1/desc_furaffinity.txt
Normal file
9
test/description/output_1/desc_furaffinity.txt
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[b]Hello world![/b]
|
||||
|
||||
This is just a [u]simple[/u] test to show that basic functionality of [url=https://github.com/BadMannersXYZ/upload-generator]upload-generator[/url] [i]works[/i]. And this is running in a unit test.
|
||||
|
||||
Reminder that I am :iconUserFuraffinity:!
|
||||
|
||||
My friend: :iconFriendFa:
|
||||
|
||||
[url=https://example.com/generic]Check this page![/url]
|
||||
9
test/description/output_1/desc_inkbunny.txt
Normal file
9
test/description/output_1/desc_inkbunny.txt
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[b]Hello world![/b]
|
||||
|
||||
This is just a [u]simple[/u] test to show that basic functionality of [url=https://github.com/BadMannersXYZ/upload-generator]upload-generator[/url] [i]works[/i]. And this is running in a unit test.
|
||||
|
||||
Reminder that I am [iconname]UserInkbunny[/iconname]!
|
||||
|
||||
My friend: [fa]FriendFa[/fa] (I dunno his account here...)
|
||||
|
||||
[url=https://example.com/ib]Check this page![/url]
|
||||
9
test/description/output_1/desc_sofurry.txt
Normal file
9
test/description/output_1/desc_sofurry.txt
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[b]Hello world![/b]
|
||||
|
||||
This is just a [u]simple[/u] test to show that basic functionality of [url=https://github.com/BadMannersXYZ/upload-generator]upload-generator[/url] [i]works[/i]. And this is running in a unit test.
|
||||
|
||||
Reminder that I am :iconUserSoFurry:!
|
||||
|
||||
My friend: :iconFriendSoFurry:
|
||||
|
||||
[url=https://example.com/generic]Check this page![/url]
|
||||
9
test/description/output_1/desc_weasyl.md
Normal file
9
test/description/output_1/desc_weasyl.md
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
**Hello world!**
|
||||
|
||||
This is just a <u>simple</u> test to show that basic functionality of [upload-generator](https://github.com/BadMannersXYZ/upload-generator) *works*. And this is running in a unit test.
|
||||
|
||||
Reminder that I am <!~UserWeasyl>!
|
||||
|
||||
My friend: <fa:FriendFa> (I dunno his account here...)
|
||||
|
||||
[Check this page!](https://example.com/generic)
|
||||
12
test/description/output_2/desc_aryion.txt
Normal file
12
test/description/output_2/desc_aryion.txt
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
:iconUserAryion:
|
||||
|
||||
-> :iconEkaPerson: :iconEkaPerson:
|
||||
[url=https://furaffinity.net/user/FaPerson]FaName[/url] [url=https://furaffinity.net/user/FaPerson]FaPerson[/url]
|
||||
[url=https://inkbunny.net/IbPerson]IbName[/url] [url=https://inkbunny.net/IbPerson]IbPerson[/url]
|
||||
[url=https://sfperson.sofurry.com]SfName[/url] [url=https://sfperson.sofurry.com]SfPerson[/url]
|
||||
[url=https://www.weasyl.com/~weasylperson]WeasylName[/url] [url=https://www.weasyl.com/~weasylperson]WeasylPerson[/url]
|
||||
[url=https://twitter.com/XPerson]XName[/url] [url=https://twitter.com/XPerson]XPerson[/url]
|
||||
[url=https://example.com/@MastodonPerson]MastodonName[/url] [url=https://example.com/@MastodonPerson]MastodonPerson@example.com[/url]
|
||||
[url=https://example.net/GenericPerson]GenericName[/url]
|
||||
|
||||
[url=https://example.com/aryion]Link[/url]
|
||||
12
test/description/output_2/desc_furaffinity.txt
Normal file
12
test/description/output_2/desc_furaffinity.txt
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
:iconUserFuraffinity:
|
||||
|
||||
[url=https://aryion.com/g4/user/EkaPerson]EkaName[/url] [url=https://aryion.com/g4/user/EkaPerson]EkaPerson[/url]
|
||||
-> :iconFaPerson: :iconFaPerson:
|
||||
[url=https://inkbunny.net/IbPerson]IbName[/url] [url=https://inkbunny.net/IbPerson]IbPerson[/url]
|
||||
[url=https://sfperson.sofurry.com]SfName[/url] [url=https://sfperson.sofurry.com]SfPerson[/url]
|
||||
[url=https://www.weasyl.com/~weasylperson]WeasylName[/url] [url=https://www.weasyl.com/~weasylperson]WeasylPerson[/url]
|
||||
[url=https://twitter.com/XPerson]XName[/url] [url=https://twitter.com/XPerson]XPerson[/url]
|
||||
[url=https://example.com/@MastodonPerson]MastodonName[/url] [url=https://example.com/@MastodonPerson]MastodonPerson@example.com[/url]
|
||||
[url=https://example.net/GenericPerson]GenericName[/url]
|
||||
|
||||
[url=https://example.com/furaffinity]Link[/url]
|
||||
12
test/description/output_2/desc_inkbunny.txt
Normal file
12
test/description/output_2/desc_inkbunny.txt
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[iconname]UserInkbunny[/iconname]
|
||||
|
||||
[url=https://aryion.com/g4/user/EkaPerson]EkaName[/url] [url=https://aryion.com/g4/user/EkaPerson]EkaPerson[/url]
|
||||
[fa]FaPerson[/fa] [fa]FaPerson[/fa]
|
||||
-> [iconname]IbPerson[/iconname] [iconname]IbPerson[/iconname]
|
||||
[sf]SfPerson[/sf] [sf]SfPerson[/sf]
|
||||
[weasyl]weasylperson[/weasyl] [weasyl]weasylperson[/weasyl]
|
||||
[url=https://twitter.com/XPerson]XName[/url] [url=https://twitter.com/XPerson]XPerson[/url]
|
||||
[url=https://example.com/@MastodonPerson]MastodonName[/url] [url=https://example.com/@MastodonPerson]MastodonPerson@example.com[/url]
|
||||
[url=https://example.net/GenericPerson]GenericName[/url]
|
||||
|
||||
[url=https://example.com/inkbunny]Link[/url]
|
||||
12
test/description/output_2/desc_sofurry.txt
Normal file
12
test/description/output_2/desc_sofurry.txt
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
:iconUserSoFurry:
|
||||
|
||||
[url=https://aryion.com/g4/user/EkaPerson]EkaName[/url] [url=https://aryion.com/g4/user/EkaPerson]EkaPerson[/url]
|
||||
fa!FaPerson fa!FaPerson
|
||||
ib!IbPerson ib!IbPerson
|
||||
-> :iconSfPerson: :iconSfPerson:
|
||||
[url=https://www.weasyl.com/~weasylperson]WeasylName[/url] [url=https://www.weasyl.com/~weasylperson]WeasylPerson[/url]
|
||||
[url=https://twitter.com/XPerson]XName[/url] [url=https://twitter.com/XPerson]XPerson[/url]
|
||||
[url=https://example.com/@MastodonPerson]MastodonName[/url] [url=https://example.com/@MastodonPerson]MastodonPerson@example.com[/url]
|
||||
[url=https://example.net/GenericPerson]GenericName[/url]
|
||||
|
||||
[url=https://example.com/sofurry]Link[/url]
|
||||
12
test/description/output_2/desc_weasyl.md
Normal file
12
test/description/output_2/desc_weasyl.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<!~UserWeasyl>
|
||||
|
||||
[EkaName](https://aryion.com/g4/user/EkaPerson) [EkaPerson](https://aryion.com/g4/user/EkaPerson)
|
||||
<fa:FaPerson> <fa:FaPerson>
|
||||
<ib:IbPerson> <ib:IbPerson>
|
||||
<sf:SfPerson> <sf:SfPerson>
|
||||
-> <!~WeasylPerson> <!~WeasylPerson>
|
||||
[XName](https://twitter.com/XPerson) [XPerson](https://twitter.com/XPerson)
|
||||
[MastodonName](https://example.com/@MastodonPerson) [MastodonPerson@example.com](https://example.com/@MastodonPerson)
|
||||
[GenericName](https://example.net/GenericPerson)
|
||||
|
||||
[Link](https://example.com/generic)
|
||||
Reference in a new issue