Following commit 9c4629dafc3aafc10f952824efd448700ad3363e, specify that hashing is deterministic and uses a specific algorithm.
--
MOS_MIGRATED_REVID=128070666
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java b/src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java
index b93ce6e..725a21f 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java
@@ -1485,9 +1485,7 @@
@Test
public void testHash() throws Exception {
- // This test is too strong, in that it tests whether the hash value of the string follows
- // Java's specific algorithm for Strings. If our hash implementation is changed then this
- // test will have to be modified.
+ // We specify the same string hashing algorithm as String.hashCode().
new SkylarkTest()
.testStatement("hash('skylark')", "skylark".hashCode())
.testStatement("hash('google')", "google".hashCode())