aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryContextTest.java7
-rw-r--r--src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java7
2 files changed, 8 insertions, 6 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryContextTest.java b/src/test/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryContextTest.java
index 58a37331b4..4a7c7262c2 100644
--- a/src/test/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryContextTest.java
+++ b/src/test/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryContextTest.java
@@ -32,7 +32,6 @@ import com.google.devtools.build.lib.syntax.Argument.Passed;
import com.google.devtools.build.lib.syntax.BuiltinFunction;
import com.google.devtools.build.lib.syntax.FuncallExpression;
import com.google.devtools.build.lib.syntax.Identifier;
-import com.google.devtools.build.lib.syntax.Runtime;
import com.google.devtools.build.lib.syntax.Type;
import com.google.devtools.build.lib.testutil.Scratch;
import com.google.devtools.build.lib.vfs.Path;
@@ -124,9 +123,9 @@ public class SkylarkRepositoryContextTest {
scratch.file("/path/bin/def").setExecutable(true);
scratch.file("/bin/undef");
- assertThat(context.which("anything")).isEqualTo(Runtime.NONE);
- assertThat(context.which("def")).isEqualTo(Runtime.NONE);
- assertThat(context.which("undef")).isEqualTo(Runtime.NONE);
+ assertThat(context.which("anything")).isNull();
+ assertThat(context.which("def")).isNull();
+ assertThat(context.which("undef")).isNull();
assertThat(context.which("true").toString()).isEqualTo("/bin/true");
assertThat(context.which("false").toString()).isEqualTo("/path/sbin/false");
}
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
index 32932b6a73..848498b229 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
@@ -26,12 +26,14 @@ import com.google.devtools.build.lib.analysis.FileConfiguredTarget;
import com.google.devtools.build.lib.analysis.RuleConfiguredTarget;
import com.google.devtools.build.lib.analysis.TransitiveInfoCollection;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
+import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
import com.google.devtools.build.lib.packages.NativeClassObjectConstructor;
import com.google.devtools.build.lib.packages.SkylarkClassObject;
import com.google.devtools.build.lib.skylarkinterface.Param;
import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable;
import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
import com.google.devtools.build.lib.skylarkinterface.SkylarkSignature;
+import com.google.devtools.build.lib.skylarkinterface.SkylarkValue;
import com.google.devtools.build.lib.syntax.SkylarkList.MutableList;
import com.google.devtools.build.lib.testutil.TestMode;
import org.junit.Before;
@@ -59,6 +61,7 @@ public class SkylarkEvaluationTest extends EvaluationTest {
return new SkylarkTest();
}
+ @Immutable
static class Bad {
Bad () {
}
@@ -100,11 +103,11 @@ public class SkylarkEvaluationTest extends EvaluationTest {
}
@SuppressWarnings("unused")
@SkylarkCallable(name = "nullfunc_failing", doc = "", allowReturnNones = false)
- public Object nullfuncFailing(String p1, Integer p2) {
+ public SkylarkValue nullfuncFailing(String p1, Integer p2) {
return null;
}
@SkylarkCallable(name = "nullfunc_working", doc = "", allowReturnNones = true)
- public Object nullfuncWorking() {
+ public SkylarkValue nullfuncWorking() {
return null;
}
@SkylarkCallable(name = "voidfunc", doc = "")