Match only accepts regular expressions

This commit is contained in:
Owen Stephens 2019-07-21 13:19:34 +01:00
parent 0560b772f1
commit d6999de0da
2 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ public class Match implements Function {
return null; return null;
} }
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a string or a regexp"); return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a regexp");
} }
@Override @Override
@ -81,7 +81,7 @@ public class Match implements Function {
@Override @Override
public String getParams() { public String getParams() {
return "string or regexp"; return "regexp";
} }
@Override @Override

View File

@ -34,7 +34,7 @@ import com.google.refine.tests.util.TestUtils;
public class MatchTests { public class MatchTests {
@Test @Test
public void serializeMatch() { public void serializeMatch() {
String json = "{\"description\":\"Returns an array of the groups matching the given regular expression\",\"params\":\"string or regexp\",\"returns\":\"array of strings\"}"; String json = "{\"description\":\"Returns an array of the groups matching the given regular expression\",\"params\":\"regexp\",\"returns\":\"array of strings\"}";
TestUtils.isSerializedTo(new Match(), json); TestUtils.isSerializedTo(new Match(), json);
} }
} }