diff options
author | 2017-08-28 17:05:54 +0200 | |
---|---|---|
committer | 2017-08-28 17:36:01 +0200 | |
commit | 37af5d531cdd052e5a0d313e2474c32c1c79b3d3 (patch) | |
tree | e1acff56e0952310147ad616269a5ea53f94a9d5 /src/test/java/com/google/devtools | |
parent | f4e20e6cb2f8e4333460157b2dd28e9bf1822010 (diff) |
Change Identifier#boundNames to #boundIdentifiers.
RELNOTES: None
PiperOrigin-RevId: 166704851
Diffstat (limited to 'src/test/java/com/google/devtools')
-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)); } } |