mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
make sure single char interpreter name can be parsed
This commit is contained in:
parent
6b9525f303
commit
171cbeb003
2 changed files with 9 additions and 1 deletions
|
|
@ -171,7 +171,7 @@ public class Paragraph extends Job implements Serializable, Cloneable {
|
|||
}
|
||||
scriptHeadIndex = i;
|
||||
}
|
||||
if (scriptHeadIndex <= 1) {
|
||||
if (scriptHeadIndex < 1) {
|
||||
return null;
|
||||
}
|
||||
String head = text.substring(1, scriptHeadIndex + 1);
|
||||
|
|
|
|||
|
|
@ -59,6 +59,14 @@ public class ParagraphTest {
|
|||
assertEquals("", Paragraph.getScriptBody(text));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void replSingleCharName() {
|
||||
String text = "%r a";
|
||||
assertEquals("r", Paragraph.getRequiredReplName(text));
|
||||
assertEquals("a", Paragraph.getScriptBody(text));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void replNameEndsWithWhitespace() {
|
||||
String text = "%md\r\n###Hello";
|
||||
|
|
|
|||
Loading…
Reference in a new issue