MCPcopy Create free account
hub / github.com/apache/pig / testTrim

Method testTrim

test/org/apache/pig/test/TestStringUDFs.java:139–156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

137 }
138
139 @Test
140 public void testTrim() throws IOException {
141 TRIM trim = new TRIM();
142 Tuple testTuple = Util.buildTuple("nospaces");
143 assertEquals("nospaces".trim(), trim.exec(testTuple));
144
145 testTuple = Util.buildTuple("spaces right ");
146 assertEquals("spaces right", trim.exec(testTuple));
147
148 testTuple = Util.buildTuple(" spaces left");
149 assertEquals("spaces left", trim.exec(testTuple));
150
151 testTuple = Util.buildTuple(" spaces both ");
152 assertEquals("spaces both", trim.exec(testTuple));
153
154 testTuple = TupleFactory.getInstance().newTuple();
155 assertNull(trim.exec(testTuple));
156 }
157
158 @Test
159 public void testLtrim() throws IOException {

Callers

nothing calls this directly

Calls 5

buildTupleMethod · 0.95
execMethod · 0.95
getInstanceMethod · 0.95
newTupleMethod · 0.65
assertEqualsMethod · 0.45

Tested by

no test coverage detected