source: trunk/tests/org/expeditee/items/StringUtilsTest.java@ 155

Last change on this file since 155 was 155, checked in by ra33, 16 years ago
File size: 763 bytes
Line 
1package org.expeditee.items;
2
3import junit.framework.TestCase;
4
5import org.junit.Before;
6import org.junit.Test;
7
8public class StringUtilsTest extends TestCase{
9
10 @Before
11 public void setUp() throws Exception {
12 }
13
14 @Test
15 public final void testConvertNewLineChars() {
16 String windows = "Line 1\r\nLine 2\r\nLine 3\r\nLine 4";
17 String linux = "Line 1\nLine 2\nLine 3\nLine 4";
18 String mac = "Line 1\rLine 2\rLine 3\rLine 4";
19 String mix = "Line 1\rLine 2\nLine 3\r\nLine 4";
20 String result = linux;
21 assertEquals(result, StringUtils.convertNewLineChars(windows));
22 assertEquals(result, StringUtils.convertNewLineChars(linux));
23 assertEquals(result, StringUtils.convertNewLineChars(mac));
24 assertEquals(result, StringUtils.convertNewLineChars(mix));
25 }
26
27}
Note: See TracBrowser for help on using the repository browser.