Line | |
---|
1 | package org.expeditee.items;
|
---|
2 |
|
---|
3 | import junit.framework.TestCase;
|
---|
4 |
|
---|
5 | import org.junit.Before;
|
---|
6 | import org.junit.Test;
|
---|
7 |
|
---|
8 | public 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.