Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.6-rc-1
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
Here's a couple of simple tests to show the bug:
Here is unit test that fails to run.
class NegativeParameterWithNoParenthesis extends GroovyTestCase
{
def foo(a, b) {}
void testFooWithNegativeParameter()
{
foo(-1, 2)
}
void testFooWithNegativeParameterNoParenthesis()
{
foo -1, 2
}
}
-------------------------------- second test --------------------------------------
class TestDSL {
def orientation( double azimuth, double elevation ) {
println("azimuth = " + azimuth + " elevation = " + elevation);
}
def static process(dsl) {
def closure = (Closure)new GroovyShell().evaluate("{->" + dsl + "}");
closure.delegate = new TestDSL();
closure();
}
}
here's the dsl file (which I named test.dsl):
orientation -45.0, 45.0
to run the test:
TestDSL.process(new File("test.dsl").text);
Activity
Paul King
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Description |
Here's a couple of simple tests to show the bug: Here is unit test that fails to run. class NegativeParameterWithNoParenthesis extends GroovyTestCase { def foo(a, b) {} void testFooWithNegativeParameter() { foo(-1, 2) } void testFooWithNegativeParameterNoParenthesis() { foo -1, 2 } } -------------------------------- second test -------------------------------------- class TestDSL { def orientation( double azimuth, double elevation ) { println("azimuth = " + azimuth + " elevation = " + elevation); } def static process(dsl) { def closure = (Closure)new GroovyShell().evaluate("{->" + dsl + "}"); closure.delegate = new TestDSL(); closure(); } } here's the dsl file (which I named test.dsl): orientation -45.0, 45.0 to run the test: TestDSL.process(new File("test.dsl").text); |
Here's a couple of simple tests to show the bug: Here is unit test that fails to run. {code} class NegativeParameterWithNoParenthesis extends GroovyTestCase { def foo(a, b) {} void testFooWithNegativeParameter() { foo(-1, 2) } void testFooWithNegativeParameterNoParenthesis() { foo -1, 2 } } {code} -------------------------------- second test -------------------------------------- {code} class TestDSL { def orientation( double azimuth, double elevation ) { println("azimuth = " + azimuth + " elevation = " + elevation); } def static process(dsl) { def closure = (Closure)new GroovyShell().evaluate("{->" + dsl + "}"); closure.delegate = new TestDSL(); closure(); } } {code} here's the dsl file (which I named test.dsl): {code} orientation -45.0, 45.0 {code} to run the test: {code} TestDSL.process(new File("test.dsl").text); {code} |
Pascal Schumacher
made changes -
| Summary | negative first argument without parentheses fails to run | Allow negative first argument without parentheses |
| Issue Type | Bug [ 1 ] | Improvement [ 4 ] |