Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Prevter committed Oct 10, 2024
1 parent 2bcd24c commit 5dda43f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,16 @@ int main() {
RIFT_TEST_CASE("to lower: {toLower('HELLO, WORLD!')}", "to lower: hello, world!");
RIFT_TEST_CASE("Trim whitespace: {trim(' Hello, World! ')}", "Trim whitespace: Hello, World!");
RIFT_TEST_CASE("Replacing: {replace('Hello, World!', 'World', 'Universe')}", "Replacing: Hello, Universe!");
RIFT_TEST_CASE("{'escaped \\' quote'} {'single \" quote'} {\"double ' quote \"}", "escaped ' quote single \" quote double ' quote ");
RIFT_TEST_CASE("{monthName} {day}{ day > 3 || day < 21 ? 'th' : day % 10 == 1 ? 'st' : day % 10 == 2 ? 'nd' : day % 10 == 3 ? 'rd' : 'th' }, {year}",
"October 10th, 2024",
{ VALUE("monthName", "October"), VALUE("day", 10), VALUE("year", 2024) });
RIFT_TEST_CASE("{monthName} {day}{ordinal(day)}, {year}", "October 10th, 2024",
{ VALUE("monthName", "October"), VALUE("day", 10), VALUE("year", 2024) });
RIFT_TEST_CASE(R"({'escaped \' quote'} {'single " quote'} {"double ' quote "})", "escaped ' quote single \" quote double ' quote ");
RIFT_TEST_CASE("Hello!\\nNewline:{'\\n'}123", "Hello!\nNewline:\n123");
RIFT_TEST_CASE("{null ? 'true' : 'false'}", "false");
RIFT_TEST_CASE("{(true || null) == true}", "true");
RIFT_TEST_CASE("{true ?? 'cool'}{false ?? 'not cool'}", "cool");
}

// Show the results
Expand Down

0 comments on commit 5dda43f

Please sign in to comment.