diff options
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/syntax/LValueBoundNamesTest.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/LValueBoundNamesTest.java b/src/test/java/com/google/devtools/build/lib/syntax/LValueBoundNamesTest.java index b2ae351475..53750c021a 100644 --- a/src/test/java/com/google/devtools/build/lib/syntax/LValueBoundNamesTest.java +++ b/src/test/java/com/google/devtools/build/lib/syntax/LValueBoundNamesTest.java @@ -15,11 +15,13 @@ package com.google.devtools.build.lib.syntax; import com.google.common.truth.Truth; import java.util.Arrays; +import java.util.Set; +import java.util.stream.Collectors; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -/** A test for {@link LValue#boundNames()}. */ +/** A test for {@link LValue#boundIdentifiers}()}. */ @RunWith(JUnit4.class) public class LValueBoundNamesTest { @@ -48,10 +50,12 @@ public class LValueBoundNamesTest { assertBoundNames("[[x], y], [z, w[1]] = 1", "x", "y", "z"); } - private static void assertBoundNames(String assignment, String... boundNames) { + private static void assertBoundNames(String assignment, String... expectedBoundNames) { BuildFileAST buildFileAST = BuildFileAST .parseSkylarkString(Environment.FAIL_FAST_HANDLER, assignment); LValue lValue = ((AssignmentStatement) buildFileAST.getStatements().get(0)).getLValue(); - Truth.assertThat(lValue.boundNames()).containsExactlyElementsIn(Arrays.asList(boundNames)); + Set<String> boundNames = + lValue.boundIdentifiers().stream().map(Identifier::getName).collect(Collectors.toSet()); + Truth.assertThat(boundNames).containsExactlyElementsIn(Arrays.asList(expectedBoundNames)); } } |