-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #722 from Golmote/tests-lolcode
Add tests for LOLCODE
- Loading branch information
Showing
10 changed files
with
276 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
WIN | ||
FAIL | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["boolean", "WIN"], | ||
["boolean", "FAIL"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for booleans. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
OBTW foo | ||
bar TLDR | ||
BTW foobar | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["comment", "OBTW foo\r\nbar TLDR"], | ||
["comment", "BTW foobar"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for single-line and multi-line comments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
I IZ foobar | ||
HOW IZ I foobar | ||
IZ fooBAR | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["keyword", "I IZ"], | ||
["function", "foobar"], | ||
["keyword", "HOW IZ I"], | ||
["function", "foobar"], | ||
["keyword", "IZ"], | ||
["function", "fooBAR"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for functions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
O HAI IM | ||
KTHX | ||
HAI | ||
KTHXBYE | ||
I HAS A | ||
ITZ | ||
ITZ A | ||
R | ||
AN | ||
MKAY | ||
SMOOSH | ||
MAEK | ||
IS NOW | ||
IS NOW A | ||
VISIBLE | ||
GIMMEH | ||
O RLY? | ||
YA RLY | ||
NO WAI | ||
OIC | ||
MEBBE | ||
WTF? | ||
OMG | ||
OMGWTF | ||
GTFO | ||
IM IN YR | ||
IM OUTTA YR | ||
FOUND YR | ||
YR | ||
TIL | ||
WILE | ||
UPPIN | ||
NERFIN | ||
I IZ | ||
HOW IZ I foo | ||
IF U SAY SO | ||
SRS | ||
HAS A | ||
LIEK | ||
LIEK A | ||
IZ | ||
foo'Z | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["keyword", "O HAI IM"], | ||
["keyword", "KTHX"], | ||
["keyword", "HAI"], | ||
["keyword", "KTHXBYE"], | ||
["keyword", "I HAS A"], | ||
["keyword", "ITZ"], | ||
["keyword", "ITZ A"], | ||
["keyword", "R"], | ||
["keyword", "AN"], | ||
["keyword", "MKAY"], | ||
["keyword", "SMOOSH"], | ||
["keyword", "MAEK"], | ||
["keyword", "IS NOW"], | ||
["keyword", "IS NOW A"], | ||
["keyword", "VISIBLE"], | ||
["keyword", "GIMMEH"], | ||
["keyword", "O RLY?"], | ||
["keyword", "YA RLY"], | ||
["keyword", "NO WAI"], | ||
["keyword", "OIC"], | ||
["keyword", "MEBBE"], | ||
["keyword", "WTF?"], | ||
["keyword", "OMG"], | ||
["keyword", "OMGWTF"], | ||
["keyword", "GTFO"], | ||
["keyword", "IM IN YR"], | ||
["keyword", "IM OUTTA YR"], | ||
["keyword", "FOUND YR"], | ||
["keyword", "YR"], | ||
["keyword", "TIL"], | ||
["keyword", "WILE"], | ||
["keyword", "UPPIN"], | ||
["keyword", "NERFIN"], | ||
["keyword", "I IZ"], | ||
["keyword", "HOW IZ I"], ["function", "foo"], | ||
["keyword", "IF U SAY SO"], | ||
["keyword", "SRS"], | ||
["keyword", "HAS A"], | ||
["keyword", "LIEK"], | ||
["keyword", "LIEK A"], | ||
["keyword", "IZ"], | ||
"\r\nfoo", ["keyword", "'Z"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for all keywords. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
IM IN YR foobar | ||
IM OUTTA YR fooBAR | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["keyword", "IM IN YR"], | ||
["label", "foobar"], | ||
["keyword", "IM OUTTA YR"], | ||
["label", "fooBAR"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for labels. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
42 | ||
3.14159 | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["number", "42"], | ||
["number", "3.14159"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for numbers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
NOT | ||
BOTH SAEM | ||
DIFFRINT | ||
SUM OF | ||
DIFF OF | ||
PRODUKT OF | ||
QUOSHUNT OF | ||
MOD OF | ||
BIGGR OF | ||
SMALLR OF | ||
BOTH OF | ||
EITHER OF | ||
WON OF | ||
ALL OF | ||
ANY OF | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["operator", "NOT"], | ||
["operator", "BOTH SAEM"], | ||
["operator", "DIFFRINT"], | ||
["operator", "SUM OF"], | ||
["operator", "DIFF OF"], | ||
["operator", "PRODUKT OF"], | ||
["operator", "QUOSHUNT OF"], | ||
["operator", "MOD OF"], | ||
["operator", "BIGGR OF"], | ||
["operator", "SMALLR OF"], | ||
["operator", "BOTH OF"], | ||
["operator", "EITHER OF"], | ||
["operator", "WON OF"], | ||
["operator", "ALL OF"], | ||
["operator", "ANY OF"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for all operators. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"" | ||
"foobar" | ||
"fo:"o" | ||
"foo:)bar:>baz" | ||
"foo:{bar}baz" | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["string", ["\"\""]], | ||
["string", ["\"foobar\""]], | ||
["string", [ | ||
"\"fo", | ||
["symbol", ":\""], | ||
"o\"" | ||
]], | ||
["string", [ | ||
"\"foo", | ||
["symbol", ":)"], | ||
"bar", | ||
["symbol", ":>"], | ||
"baz\"" | ||
]], | ||
["string", [ | ||
"\"foo", | ||
["variable", ":{bar}"], | ||
"baz\"" | ||
]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for strings, with variables and symbols in them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
YARN A YARN | ||
NUMBR A NUMBR | ||
NUMBAR A NUMBAR | ||
TROOF A TROOF | ||
BUKKIT A BUKKIT | ||
NOOB A NOOB | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["symbol", ["YARN"]], | ||
["symbol", [["keyword", "A"], " YARN"]], | ||
["symbol", ["NUMBR"]], | ||
["symbol", [["keyword", "A"], " NUMBR"]], | ||
["symbol", ["NUMBAR"]], | ||
["symbol", [["keyword", "A"], " NUMBAR"]], | ||
["symbol", ["TROOF"]], | ||
["symbol", [["keyword", "A"], " TROOF"]], | ||
["symbol", ["BUKKIT"]], | ||
["symbol", [["keyword", "A"], " BUKKIT"]], | ||
["symbol", ["NOOB"]], | ||
["symbol", [["keyword", "A"], " NOOB"]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for symbols, optionally prefixed by "A ". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
IT | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["variable", "IT"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for variables. |