mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 21:51:23 +00:00
GUACAMOLE-1081: Implement token modifiers for upper and lower case.
This commit is contained in:
@@ -39,6 +39,7 @@ public class TokenFilterTest {
|
||||
TokenFilter tokenFilter = new TokenFilter();
|
||||
tokenFilter.setToken("TOKEN_A", "value-of-a");
|
||||
tokenFilter.setToken("TOKEN_B", "value-of-b");
|
||||
tokenFilter.setToken("TOKEN_C", "Value-of-C");
|
||||
|
||||
// Test basic substitution and escaping
|
||||
assertEquals(
|
||||
@@ -48,8 +49,23 @@ public class TokenFilterTest {
|
||||
|
||||
// Unknown tokens must be interpreted as literals
|
||||
assertEquals(
|
||||
"${NOPE}hellovalue-of-aworld${TOKEN_C}",
|
||||
tokenFilter.filter("${NOPE}hello${TOKEN_A}world${TOKEN_C}")
|
||||
"${NOPE}hellovalue-of-aworld${TOKEN_D}",
|
||||
tokenFilter.filter("${NOPE}hello${TOKEN_A}world${TOKEN_D}")
|
||||
);
|
||||
|
||||
assertEquals(
|
||||
"Value-of-C",
|
||||
tokenFilter.filter("${TOKEN_C}")
|
||||
);
|
||||
|
||||
assertEquals(
|
||||
"value-of-c",
|
||||
tokenFilter.filter("${TOKEN_C:lower}")
|
||||
);
|
||||
|
||||
assertEquals(
|
||||
"VALUE-OF-C",
|
||||
tokenFilter.filter("${TOKEN_C:upper}")
|
||||
);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user