
package com.exedio.cope.lib;

public class TrimTest extends AbstractLibTest
{
	private void assertTrim(final String expected, final String actualLongString, final int maxLength)
	{
		final String actual = Database.trimString(actualLongString, maxLength);
		assertEquals(">"+expected+"< >"+actual+"<", expected, actual);
	}

	public void testTrim()
	{
		assertTrim("FST", "FirstSecondThird", 5);
		assertTrim("FirSecThi", "FirstSecondThird", 10);
		assertTrim("FirstSeconThird", "FirstSecondThird", 15);
		assertTrim("FirstSecondThird", "FirstSecondThird", 18);
	}

}

@@ -554,15 +554,118 @@
 d%22, 18);
+%0A%0A%09%09assertTrim(%221ir2ec3hi%22, %221irst2econd3hird%22, 10);%0A%09%09assertTrim(%22_ir_ec_hi%22, %22_irst_econd_hird%22, 10);
 %0A%09%7D%0A%0A%7D%0A

test numers and underlines