@Test public void assert_split_1() { String example = "boo:and:foo"; String[] act = example.split(":", 2); assertEquals("boo", act[0]); assertEquals("and:foo", act[1]); }
@Test public void assert_split_2() { String example = "boo:and:foo"; String[] act = example.split(":", 5); assertEquals("boo", act[0]); assertEquals("and", act[1]); assertEquals("foo", act[2]); }
@Test public void assert_split_3() { String example = "boo:and:foo"; String[] act = example.split(":", -2); assertEquals("boo", act[0]); assertEquals("and", act[1]); assertEquals("foo", act[2]); }
@Test public void assert_split_4() { String example = "boo:and:foo"; String[] act = example.split(":", -1); assertEquals("boo", act[0]); assertEquals("and", act[1]); assertEquals("foo", act[2]); }
@Test public void assert_split_5() { String example = "boo:and:foo"; String[] act = example.split("o", 0); assertEquals("b", act[0]); assertEquals("", act[1]); assertEquals(":and:f", act[2]); }
|