diff options
author | vladmos <vladmos@google.com> | 2017-07-06 15:46:30 -0400 |
---|---|---|
committer | John Cater <jcater@google.com> | 2017-07-07 07:07:43 -0400 |
commit | 0abc67898b4553a70a1a2b43721b993ad8a5a8f2 (patch) | |
tree | 76ebdbea6500c3725f059fdbc5078c30fb1dc9c2 /src/test/java | |
parent | 76a08f2d3302ac3657bf72ef72ba736bab096d5f (diff) |
Clean up string representations for aspects
If --incompatible_descriptive_string_representations is passed, aspects are
converted to strings using `str`, `repr` and `print` functions differently
(more descriptive, without leaking information that shouldn't be accessible).
PiperOrigin-RevId: 161116840
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/skylark/SkylarkStringRepresentationsTest.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkStringRepresentationsTest.java b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkStringRepresentationsTest.java index d503ec9803..35d4d1d0d4 100644 --- a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkStringRepresentationsTest.java +++ b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkStringRepresentationsTest.java @@ -232,6 +232,13 @@ public class SkylarkStringRepresentationsTest extends SkylarkTestCase { } @Test + public void testStringRepresentations_Aspects() throws Exception { + setSkylarkSemanticsOptions("--incompatible_descriptive_string_representations=true"); + + assertStringRepresentation("aspect(implementation=str)", "<aspect>"); + } + + @Test public void testLegacyStringRepresentations_Labels() throws Exception { setSkylarkSemanticsOptions("--incompatible_descriptive_string_representations=false"); |