RESOLVED - # 99: Change StringBuffer deleteCharAt() to integer
http://bugs.koc.se/view.php?id=99
This commit is contained in:
parent
a1acca0545
commit
e46ecc1dca
10 changed files with 99 additions and 66 deletions
|
|
@ -5,18 +5,13 @@ import static org.junit.Assert.assertEquals;
|
|||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.carrotsearch.junitbenchmarks.AbstractBenchmark;
|
||||
import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
|
||||
|
||||
import zutil.parser.DataNode;
|
||||
import zutil.parser.json.JSONParser;
|
||||
|
||||
|
||||
public class JSONTest extends AbstractBenchmark{
|
||||
public static final int ITERATION = 200;
|
||||
public class JSONTest{
|
||||
|
||||
@Test
|
||||
@BenchmarkOptions(benchmarkRounds = ITERATION)
|
||||
public void JSONParser() {
|
||||
JSONParser parser = new JSONParser();
|
||||
|
||||
|
|
|
|||
27
src/zutil/test/ParserTest.java
Normal file
27
src/zutil/test/ParserTest.java
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package zutil.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import zutil.parser.BBCodeParser;
|
||||
|
||||
|
||||
public class ParserTest{
|
||||
|
||||
@Test
|
||||
public void BBCodeParser() {
|
||||
BBCodeParser parser = new BBCodeParser();
|
||||
|
||||
assertEquals("1234", parser.read("1234"));
|
||||
assertEquals("<i>1234</i>", parser.read("[i]1234[/i]"));
|
||||
assertEquals("[apa]lol[/apa]", parser.read("[apa]lol[/apa]"));
|
||||
assertEquals("jshdkj <u>lol [apa]lol[/apa]</u>", parser.read("jshdkj [u]lol [apa]lol[/apa]"));
|
||||
//assertEquals("jshdkj [m]lol[/k] <i>lol</i>", parser.read("jshdkj [m]lol[/k] [i]lol[/i]"));
|
||||
assertEquals("jshdkj [m", parser.read("jshdkj [m"));
|
||||
assertEquals("jshdkj [/m", parser.read("jshdkj [/m"));
|
||||
assertEquals("jshdkj m]", parser.read("jshdkj m]"));
|
||||
assertEquals("jshdkj <br />", parser.read("jshdkj <br />"));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue