aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java
diff options
context:
space:
mode:
authorGravatar cparsons <cparsons@google.com>2018-03-21 11:06:13 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-21 11:08:19 -0700
commita95884e5b989577e58d111e72ee50e16ebf1045b (patch)
treed9fac959c9c450d5eca8cf67d818955d398e2de2 /src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java
parentbaba6a72f1f03dda9b63895d253d346cadd6574a (diff)
Change error messaging of @SkylarkCallable invocations to match @SkylarkSignature more closely.
Also clarify the method representation in these error messages is for the attempted method *call*, not the actual method signature. RELNOTES: None. PiperOrigin-RevId: 189935148
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java
index edb8d48fbb..43073e9342 100644
--- a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java
@@ -299,7 +299,7 @@ public class SkylarkRuleImplementationFunctionsTest extends SkylarkTestCase {
public void testCreateSpawnActionArgumentsBadExecutable() throws Exception {
checkErrorContains(
createRuleContext("//foo:foo"),
- "Cannot convert parameter 'executable' to type File or string, in method "
+ "expected value of type 'File or string' for parameter 'executable', in method call "
+ "run(list inputs, list outputs, list arguments, int executable) of 'actions'",
"ruleContext.actions.run(",
" inputs = ruleContext.files.srcs,",
@@ -355,7 +355,7 @@ public class SkylarkRuleImplementationFunctionsTest extends SkylarkTestCase {
SkylarkRuleContext ruleContext = createRuleContext("//foo:foo");
checkErrorContains(
ruleContext,
- "unexpected keyword 'bad_param', in method run("
+ "unexpected keyword 'bad_param', in method call run("
+ "list outputs, string bad_param, File executable) of 'actions'",
"f = ruleContext.actions.declare_file('foo.sh')",
"ruleContext.actions.run(outputs=[], bad_param = 'some text', executable = f)");
@@ -433,7 +433,8 @@ public class SkylarkRuleImplementationFunctionsTest extends SkylarkTestCase {
checkErrorContains(
ruleContext,
- "parameter 'mnemonic' has no default value, in method do_nothing(list inputs) of 'actions'",
+ "parameter 'mnemonic' has no default value, "
+ + "in method call do_nothing(list inputs) of 'actions'",
"ruleContext.actions.do_nothing(inputs = ruleContext.files.srcs)");
}
@@ -636,7 +637,7 @@ public class SkylarkRuleImplementationFunctionsTest extends SkylarkTestCase {
SkylarkRuleContext ruleContext = createRuleContext("//foo:foo");
checkErrorContains(
ruleContext,
- "Cannot convert parameter 'content' to type string or Args",
+ "expected value of type 'string or Args' for parameter 'content'",
"ruleContext.actions.write(",
" output = ruleContext.files.srcs[0],",
" content = 1,",