bb.util
Class StringUtil.UnitTest
java.lang.Object
bb.util.StringUtil.UnitTest
- Enclosing class:
- StringUtil
public static class StringUtil.UnitTest
- extends Object
See the Overview page of the project's javadocs for a general description of this unit test class.
Method Summary |
void |
benchmark_splitByChar()
Results on 2009-06-26 (2.5 GHz Xeon E5420 desktop, jdk 1.6.0_14 server jvm):
s contains 3 tokens:
splitByChar: first = 59.715 us, mean = 113.615 ns (CI deltas: -93.321 ps, +101.454 ps), sd = 1.571 us (CI deltas: -230.824 ns, +347.740 ns) WARNING: execution times have mild outliers, SD VALUES MAY BE INACCURATE
String.split: first = 136.978 us, mean = 784.090 ns (CI deltas: -402.093 ps, +412.352 ps), sd = 2.323 us (CI deltas: -338.734 ns, +437.863 ns) WARNING: SD VALUES MAY BE INACCURATE
Pattern.split: first = 75.389 us, mean = 459.917 ns (CI deltas: -427.344 ps, +409.991 ps), sd = 3.392 us (CI deltas: -398.413 ns, +570.629 ns) WARNING: execution times may have serial correlation, SD VALUES MAY BE INACCURATE
s contains 10 tokens:
splitByChar: first = 59.712 us, mean = 329.528 ns (CI deltas: -366.100 ps, +422.782 ps), sd = 3.201 us (CI deltas: -559.421 ns, +1.169 us) WARNING: execution times have mild outliers, SD VALUES MAY BE INACCURATE
String.split: first = 156.493 us, mean = 1.427 us (CI deltas: -2.007 ns, +2.222 ns), sd = 8.547 us (CI deltas: -1.506 us, +2.289 us) WARNING: execution times have mild outliers, SD VALUES MAY BE INACCURATE
Pattern.split: first = 77.697 us, mean = 1.106 us (CI deltas: -2.095 ns, +2.236 ns), sd = 8.796 us (CI deltas: -1.361 us, +1.883 us) WARNING: SD VALUES MAY BE INACCURATE
|
void |
benchmark_splitByLiteral()
Results on 2009-06-26 (2.5 GHz Xeon E5420 desktop, jdk 1.6.0_14 server jvm):
s contains 3 tokens:
splitByLiteral: first = 107.094 us, mean = 192.368 ns (CI deltas: -180.591 ps, +167.583 ps), sd = 1.987 us (CI deltas: -305.803 ns, +542.034 ns) WARNING: execution times have mild outliers, SD VALUES MAY BE INACCURATE
String.split: first = 136.978 us, mean = 784.090 ns (CI deltas: -402.093 ps, +412.352 ps), sd = 2.323 us (CI deltas: -338.734 ns, +437.863 ns) WARNING: SD VALUES MAY BE INACCURATE
Pattern.split: first = 75.389 us, mean = 459.917 ns (CI deltas: -427.344 ps, +409.991 ps), sd = 3.392 us (CI deltas: -398.413 ns, +570.629 ns) WARNING: execution times may have serial correlation, SD VALUES MAY BE INACCURATE
s contains 10 tokens:
splitByLiteral: first = 79.09 us, mean = 510.290 ns (CI deltas: -1.048 ns, +1.142 ns), sd = 6.255 us (CI deltas: -1.026 us, +1.481 us) WARNING: execution times have mild outliers, SD VALUES MAY BE INACCURATE
String.split: first = 157.356 us, mean = 1.421 us (CI deltas: -2.105 ns, +2.217 ns), sd = 8.728 us (CI deltas: -1.131 us, +1.496 us) WARNING: SD VALUES MAY BE INACCURATE
Pattern.split: first = 76.199 us, mean = 1.109 us (CI deltas: -2.013 ns, +1.994 ns), sd = 8.100 us (CI deltas: -1.190 us, +1.702 us) WARNING: SD VALUES MAY BE INACCURATE
|
void |
investigate_bitFlip()
|
private List<String> |
String_split(String s,
String delimiter)
|
void |
test_arraysToTextColumns()
|
void |
test_asciiBytesToChars_fail()
|
void |
test_asciiBytesToChars()
|
void |
test_diagnoseProblem()
|
void |
test_ensureSuffix()
|
void |
test_indentLines()
|
void |
test_isAllAsciiChars()
|
void |
test_isTrimmable()
|
void |
test_keepWithinLength()
|
void |
test_newString()
|
void |
test_normalizeWhitespace()
|
void |
test_parseLines()
|
void |
test_quoteWhitespaceTokenize()
|
void |
test_repeatChars()
|
void |
test_splitByChar_fail1()
|
void |
test_splitByChar_fail2()
|
void |
test_splitByChar_fail3()
|
void |
test_splitByChar_fail4()
|
void |
test_splitByChar_pass()
|
void |
test_splitByLiteral_fail1()
|
void |
test_splitByLiteral_fail2()
|
void |
test_splitByLiteral_fail3()
|
void |
test_splitByLiteral_fail4()
|
void |
test_splitByLiteral_pass()
|
void |
test_toLength()
|
void |
test_toMatrix()
|
void |
test_toString()
|
void |
test_toStringAscii()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringUtil.UnitTest
public StringUtil.UnitTest()
test_newString
public void test_newString()
throws Exception
- Throws:
Exception
test_ensureSuffix
public void test_ensureSuffix()
test_toLength
public void test_toLength()
test_repeatChars
public void test_repeatChars()
test_keepWithinLength
public void test_keepWithinLength()
test_arraysToTextColumns
public void test_arraysToTextColumns()
test_toMatrix
public void test_toMatrix()
test_isAllAsciiChars
public void test_isAllAsciiChars()
test_asciiBytesToChars
public void test_asciiBytesToChars()
test_asciiBytesToChars_fail
public void test_asciiBytesToChars_fail()
test_toStringAscii
public void test_toStringAscii()
test_isTrimmable
public void test_isTrimmable()
test_normalizeWhitespace
public void test_normalizeWhitespace()
test_indentLines
public void test_indentLines()
test_parseLines
public void test_parseLines()
test_splitByLiteral_pass
public void test_splitByLiteral_pass()
test_splitByLiteral_fail1
public void test_splitByLiteral_fail1()
test_splitByLiteral_fail2
public void test_splitByLiteral_fail2()
test_splitByLiteral_fail3
public void test_splitByLiteral_fail3()
test_splitByLiteral_fail4
public void test_splitByLiteral_fail4()
benchmark_splitByLiteral
public void benchmark_splitByLiteral()
throws Exception
- Results on 2009-06-26 (2.5 GHz Xeon E5420 desktop, jdk 1.6.0_14 server jvm):
s contains 3 tokens:
splitByLiteral: first = 107.094 us, mean = 192.368 ns (CI deltas: -180.591 ps, +167.583 ps), sd = 1.987 us (CI deltas: -305.803 ns, +542.034 ns) WARNING: execution times have mild outliers, SD VALUES MAY BE INACCURATE
String.split: first = 136.978 us, mean = 784.090 ns (CI deltas: -402.093 ps, +412.352 ps), sd = 2.323 us (CI deltas: -338.734 ns, +437.863 ns) WARNING: SD VALUES MAY BE INACCURATE
Pattern.split: first = 75.389 us, mean = 459.917 ns (CI deltas: -427.344 ps, +409.991 ps), sd = 3.392 us (CI deltas: -398.413 ns, +570.629 ns) WARNING: execution times may have serial correlation, SD VALUES MAY BE INACCURATE
s contains 10 tokens:
splitByLiteral: first = 79.09 us, mean = 510.290 ns (CI deltas: -1.048 ns, +1.142 ns), sd = 6.255 us (CI deltas: -1.026 us, +1.481 us) WARNING: execution times have mild outliers, SD VALUES MAY BE INACCURATE
String.split: first = 157.356 us, mean = 1.421 us (CI deltas: -2.105 ns, +2.217 ns), sd = 8.728 us (CI deltas: -1.131 us, +1.496 us) WARNING: SD VALUES MAY BE INACCURATE
Pattern.split: first = 76.199 us, mean = 1.109 us (CI deltas: -2.013 ns, +1.994 ns), sd = 8.100 us (CI deltas: -1.190 us, +1.702 us) WARNING: SD VALUES MAY BE INACCURATE
- Throws:
Exception
test_splitByChar_pass
public void test_splitByChar_pass()
test_splitByChar_fail1
public void test_splitByChar_fail1()
test_splitByChar_fail2
public void test_splitByChar_fail2()
test_splitByChar_fail3
public void test_splitByChar_fail3()
test_splitByChar_fail4
public void test_splitByChar_fail4()
benchmark_splitByChar
public void benchmark_splitByChar()
throws Exception
- Results on 2009-06-26 (2.5 GHz Xeon E5420 desktop, jdk 1.6.0_14 server jvm):
s contains 3 tokens:
splitByChar: first = 59.715 us, mean = 113.615 ns (CI deltas: -93.321 ps, +101.454 ps), sd = 1.571 us (CI deltas: -230.824 ns, +347.740 ns) WARNING: execution times have mild outliers, SD VALUES MAY BE INACCURATE
String.split: first = 136.978 us, mean = 784.090 ns (CI deltas: -402.093 ps, +412.352 ps), sd = 2.323 us (CI deltas: -338.734 ns, +437.863 ns) WARNING: SD VALUES MAY BE INACCURATE
Pattern.split: first = 75.389 us, mean = 459.917 ns (CI deltas: -427.344 ps, +409.991 ps), sd = 3.392 us (CI deltas: -398.413 ns, +570.629 ns) WARNING: execution times may have serial correlation, SD VALUES MAY BE INACCURATE
s contains 10 tokens:
splitByChar: first = 59.712 us, mean = 329.528 ns (CI deltas: -366.100 ps, +422.782 ps), sd = 3.201 us (CI deltas: -559.421 ns, +1.169 us) WARNING: execution times have mild outliers, SD VALUES MAY BE INACCURATE
String.split: first = 156.493 us, mean = 1.427 us (CI deltas: -2.007 ns, +2.222 ns), sd = 8.547 us (CI deltas: -1.506 us, +2.289 us) WARNING: execution times have mild outliers, SD VALUES MAY BE INACCURATE
Pattern.split: first = 77.697 us, mean = 1.106 us (CI deltas: -2.095 ns, +2.236 ns), sd = 8.796 us (CI deltas: -1.361 us, +1.883 us) WARNING: SD VALUES MAY BE INACCURATE
- Throws:
Exception
String_split
private List<String> String_split(String s,
String delimiter)
test_quoteWhitespaceTokenize
public void test_quoteWhitespaceTokenize()
test_diagnoseProblem
public void test_diagnoseProblem()
investigate_bitFlip
public void investigate_bitFlip()
test_toString
public void test_toString()