Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZeb Ford-Reitz2012-01-30 16:27:14 +0000
committerZeb Ford-Reitz2012-01-30 16:27:14 +0000
commit1df924b58419e4f5cb1a6b9e7932ec0596851785 (patch)
tree26d289eeab59b82ae6e913cf644e1c60d6c58e48 /org.eclipse.jubula.client.core.tests
parent8bce77f316eead6e3e19cfe1bf161e328b350ec7 (diff)
downloadorg.eclipse.jubula.core-1df924b58419e4f5cb1a6b9e7932ec0596851785.tar.gz
org.eclipse.jubula.core-1df924b58419e4f5cb1a6b9e7932ec0596851785.tar.xz
org.eclipse.jubula.core-1df924b58419e4f5cb1a6b9e7932ec0596851785.zip
Adds functions to parameter grammar.
The format of functions is ?<function_name>([arg1[,arg2[,...]]]). An example call would be: ?concat(prefix_, ={PARAM}, _suffix) This commit does not include built-in functions. Also, the functions are not yet evaluated during test exection.
Diffstat (limited to 'org.eclipse.jubula.client.core.tests')
-rw-r--r--org.eclipse.jubula.client.core.tests/src/org/eclipse/jubula/client/core/tests/parameter/TestParameterInput.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/org.eclipse.jubula.client.core.tests/src/org/eclipse/jubula/client/core/tests/parameter/TestParameterInput.java b/org.eclipse.jubula.client.core.tests/src/org/eclipse/jubula/client/core/tests/parameter/TestParameterInput.java
index 27b090ab3..ff38a5926 100644
--- a/org.eclipse.jubula.client.core.tests/src/org/eclipse/jubula/client/core/tests/parameter/TestParameterInput.java
+++ b/org.eclipse.jubula.client.core.tests/src/org/eclipse/jubula/client/core/tests/parameter/TestParameterInput.java
@@ -19,11 +19,11 @@ import java.io.StringReader;
import java.util.Arrays;
import java.util.Collection;
-import org.eclipse.jubula.client.core.gen.parser.parameter.lexer.Lexer;
import org.eclipse.jubula.client.core.gen.parser.parameter.lexer.LexerException;
import org.eclipse.jubula.client.core.gen.parser.parameter.node.Start;
import org.eclipse.jubula.client.core.gen.parser.parameter.parser.Parser;
import org.eclipse.jubula.client.core.gen.parser.parameter.parser.ParserException;
+import org.eclipse.jubula.client.core.parser.parameter.JubulaParameterLexer;
import org.eclipse.jubula.client.core.utils.ParsedParameter;
import org.eclipse.jubula.client.core.utils.SemanticParsingException;
import org.junit.Test;
@@ -46,7 +46,7 @@ public class TestParameterInput {
@SuppressWarnings("nls")
@Test
public void testParameterInput() throws IOException {
- Parser parser = new Parser(new Lexer(new PushbackReader(
+ Parser parser = new Parser(new JubulaParameterLexer(new PushbackReader(
new StringReader(m_inputString))));
try {
Start ast = parser.parse();
@@ -80,7 +80,10 @@ public class TestParameterInput {
{"={PARAMETER}", true},
{"=1", true},
{"={1}", true},
- {"?()", true},
+ {"?abc()", true},
+ {"?abc(arg)", true},
+ {"?abc(arg1, arg2)", true},
+ {"?abc(?abc(arg1, arg2), ={PARAM_ARG}, \\=prefix${VARIABLE_ARG}\\$\\?suffix)", true},
{"=", false}, // missing parameter name
{"={}", false}, // missing parameter name
@@ -90,11 +93,14 @@ public class TestParameterInput {
{"?", false}, // missing function body
{"?(", false}, // missing closing parentheses
{"?)", false}, // missing opening parentheses
- {"?a", false}, // invalid (literal) after function symbol
+ {"?()", false}, // missing function name
+ {"?a", false}, // missing function argument list
{"?=", false}, // invalid (parameter symbol) after function symbol
{"??", false}, // invalid (function symbol) after function symbol
{"?$", false}, // invalid (variable symbol) after function symbol
{"?''", false}, // invalid (single quote) after function symbol
+ {"?abc(?abc(arg1, arg2))", true},
+ {"?abc(?abc(arg1, arg2), ={PARAM_ARG}, prefix${VARIABLE_ARG}suffix)", true},
});
}
}

Back to the top