diff options
| author | bjculkin <bjculkin@mix.wvu.edu> | 2018-03-01 14:52:35 -0500 |
|---|---|---|
| committer | bjculkin <bjculkin@mix.wvu.edu> | 2018-03-01 14:52:35 -0500 |
| commit | c6fa9c56ee7d339f4b7d49e528bde1b15039e359 (patch) | |
| tree | 69ad0e08c9019ce37aa9beabe8e0975cb9c4d12e /base/src/test/java/bjc/utils | |
| parent | 0b373102f64fd7bfd25837a24ffb4ccb44b9d7e9 (diff) | |
Fix some CL format issues
Diffstat (limited to 'base/src/test/java/bjc/utils')
| -rw-r--r-- | base/src/test/java/bjc/utils/test/ioutils/CLFormatterTest.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/base/src/test/java/bjc/utils/test/ioutils/CLFormatterTest.java b/base/src/test/java/bjc/utils/test/ioutils/CLFormatterTest.java new file mode 100644 index 0000000..ee92558 --- /dev/null +++ b/base/src/test/java/bjc/utils/test/ioutils/CLFormatterTest.java @@ -0,0 +1,35 @@ +package bjc.utils.test.ioutils; + +import static org.junit.Assert.*; + +import bjc.utils.ioutils.format.CLFormatter; + +import org.junit.Test; + +/** + * Tests for CL format strings. + * + * @author EVE + * + */ +@SuppressWarnings("javadoc") +public class CLFormatterTest { + private CLFormatter fmt = new CLFormatter(); + + @Test + public void testFormatStringLiteral() { + assertEquals(fmt.formatString("foo"), "foo"); + } + + @Test + public void testFormatStringD() { + assertEquals(fmt.formatString("~D", 5), "5"); + assertEquals(fmt.formatString("~3D", 5), " 5"); + assertEquals(fmt.formatString("~3,'0D", 5), "005"); + } + + public void testFormatStringR() { + assertEquals(fmt.formatString("~R dog~:*~[s are~; is~] here", 3, 3 == 1), "3 dogs are here"); + } + +} |
