mirror of
https://github.com/deavmi/birchwood
synced 2024-09-20 13:22:52 +02:00
Formatting
- Explicitly make the formatting functions `public` Client - Added unit tests for formatting functions
This commit is contained in:
parent
208cfebf49
commit
033ea850f3
@ -1098,6 +1098,21 @@ public class Client : Thread
|
||||
client.directMessage("(3) Message to myself (multi)", ["birchwood", "birchwood"]);
|
||||
|
||||
|
||||
/**
|
||||
* Test formatting of text
|
||||
*/
|
||||
import birchwood.protocol.formatting;
|
||||
string formattedTextBold = bold("Hello in bold!");
|
||||
string formattedTextItalics = italics("Hello in italics!");
|
||||
string formattedTextUnderline = underline("Hello in underline!");
|
||||
string formattedTextMonospace = monospace("Hello in monospace!");
|
||||
string formattedTextStrikthrough = strikethrough("Hello in strikethrough!");
|
||||
client.channelMessage(formattedTextBold, "#birchwood");
|
||||
client.channelMessage(formattedTextItalics, "#birchwood");
|
||||
client.channelMessage(formattedTextUnderline, "#birchwood");
|
||||
client.channelMessage(formattedTextMonospace, "#birchwood");
|
||||
client.channelMessage(formattedTextStrikthrough, "#birchwood");
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -123,7 +123,7 @@ string reset_fg_bg()
|
||||
* Returns: the boldened text
|
||||
*/
|
||||
pragma(inline)
|
||||
string bold(string text)
|
||||
public string bold(string text)
|
||||
{
|
||||
return bold_code~text~bold_code;
|
||||
}
|
||||
@ -137,7 +137,7 @@ string bold(string text)
|
||||
* Returns: the italicized text
|
||||
*/
|
||||
pragma(inline)
|
||||
string italics(string text)
|
||||
public string italics(string text)
|
||||
{
|
||||
return italic_code~text~italic_code;
|
||||
}
|
||||
@ -151,7 +151,7 @@ string italics(string text)
|
||||
* Returns: the underlined text
|
||||
*/
|
||||
pragma(inline)
|
||||
string underline(string text)
|
||||
public string underline(string text)
|
||||
{
|
||||
return underline_code~text~underline_code;
|
||||
}
|
||||
@ -165,7 +165,7 @@ string underline(string text)
|
||||
* Returns: the strikethroughed text
|
||||
*/
|
||||
pragma(inline)
|
||||
string strikethrough(string text)
|
||||
public string strikethrough(string text)
|
||||
{
|
||||
return strikethrough_code~text~strikethrough_code;
|
||||
}
|
||||
@ -179,7 +179,7 @@ string strikethrough(string text)
|
||||
* Returns: the monospaced text
|
||||
*/
|
||||
pragma(inline)
|
||||
string monospace(string text)
|
||||
public string monospace(string text)
|
||||
{
|
||||
return monospace_code~text~monospace_code;
|
||||
}
|
Loading…
Reference in New Issue
Block a user