Changed license to LGPLv3 or later.
[svjatoslav_commons.git] / src / test / java / eu / svjatoslav / commons / string / CuttableStringTest.java
1 /*
2  * Svjatoslav Commons - shared library of common functionality.
3  * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
4  * 
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of version 3 of the GNU Lesser General Public License
7  * or later as published by the Free Software Foundation.
8  */
9
10 package eu.svjatoslav.commons.string;
11
12 import static org.junit.Assert.assertEquals;
13
14 import org.junit.Test;
15
16 public class CuttableStringTest {
17
18         @Test
19         public void testCutLeft() {
20
21                 final CuttableString s = new CuttableString("this is a test");
22
23                 assertEquals("this ", s.cutLeft(5));
24                 assertEquals("is ", s.cutLeft(3));
25                 assertEquals("a ", s.cutLeft(2));
26                 assertEquals("test", s.cutLeft(25));
27                 assertEquals("", s.cutLeft(5));
28
29         }
30 }