LUCENE-5207: add test

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene5207@1523350 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2013-09-14 22:48:19 +00:00
parent aaf9a830e6
commit 46d3371997
1 changed files with 16 additions and 0 deletions

View File

@ -43,4 +43,20 @@ public class TestJavascriptCompiler extends LuceneTestCase {
// expected exception
}
}
public void testWrongArity() throws Exception {
try {
JavascriptCompiler.compile("tan()");
fail();
} catch (IllegalArgumentException expected) {
assertTrue(expected.getMessage().contains("arguments for method call"));
}
try {
JavascriptCompiler.compile("tan(1, 1)");
fail();
} catch (IllegalArgumentException expected) {
assertTrue(expected.getMessage().contains("arguments for method call"));
}
}
}