aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/syntax/EvalUtilsTest.java
Commit message (Collapse)AuthorAge
* Clarify Mutability invariants, refactor some testsGravatar brandjon2017-09-29
| | | | | RELNOTES: None PiperOrigin-RevId: 170343759
* Better names for declared providers-related classes.Gravatar dslomov2017-08-01
| | | | | | | | Follows https://docs.google.com/document/d/1aAIVWvHPERDz2cv_PCFGwr8dvh5FcAkENFoRsNS4clk/. RELNOTES: None. PiperOrigin-RevId: 163728291
* Introduce --incompatible_depset_is_not_iterableGravatar laurentlb2017-06-21
| | | | | | | RELNOTES: Iterating on a `depset` object is deprecated. If you need an iterable, call the `.to_list()` method first. PiperOrigin-RevId: 159672887
* Remove all imports of org.junit.Assert except for static imports of #fail().Gravatar lberki2017-06-01
| | | | | RELNOTES: None. PiperOrigin-RevId: 157685150
* Migrate Java tests to Truth.Gravatar lberki2017-05-30
| | | | | | RELNOTES: None. PiperOrigin-RevId: 157446717
* Refactor implementation of native and Skylark declared providers.Gravatar Dmitry Lomov2017-03-03
| | | | | | | | | | | | 1) Instead of having a single class for both, split them into {Skylark,Native}ClassObjectConstructors 2) Allow NativeClassObjectConstructors to customize their instantiation logic. 3) Prepare ClassObjectConstructor.Key to be serializable. -- PiperOrigin-RevId: 148997553 MOS_MIGRATED_REVID=148997553
* Disallow comparison of objects of different types in SkylarkGravatar Vladimir Moskva2017-02-16
| | | | | | | | | | RELNOTES[INC]: It's not allowed anymore to compare objects of different types (i.e. a string to an integer) and objects for which comparison rules are not defined (i.e. a dict to another dict) using order operators. -- PiperOrigin-RevId: 147710942 MOS_MIGRATED_REVID=147710942
* Refactor SkylarkNestedSet to not implement IterableGravatar Jon Brandvein2017-01-20
| | | | | | | | | | | | | | This is not intended to be a user-visible semantic change, aside from error messages. This is to help avoid unintentional flattening of depsets, and to narrow down the number of call sites where this can occur, to help us print warning/deprecation messages. EvalUtils#toIterable will now return an ImmutableList in place of SkylarkNestedSet. This should be ok since the caller shouldn't be relying on the result being a Skylark-safe type. Code that takes Iterable because it accepts either a list or set, can instead be changed to take Object and use EvalUtils#toIterableStrict for validation. Note that NestedSet still implements Iterable, so native code can still easily and accidentally flatten sets. -- PiperOrigin-RevId: 145044023 MOS_MIGRATED_REVID=145044023
* Make EvalUtils.getDataTypeNameFromClass() look for @SkylarkModules in parent ↵Gravatar Jon Brandvein2016-10-12
| | | | | | | | | classes This is needed to let subclasses of @SkylarkModules have the same type() string as their superclass, without requiring a second annotation for the subclass. -- MOS_MIGRATED_REVID=135814343
* Rollback of commit 9c25afe750a937b2152c21a93effc8b9ba82c27b.Gravatar Ulf Adams2016-10-11
| | | | | | | | | | | | | | | *** Reason for rollback *** Seems to break some parts of aspects. *** Original change description *** Make EvalUtils.getDataTypeNameFromClass() look for @SkylarkModules in parent classes This is needed to let subclasses of @SkylarkModules have the same type() string as their superclass, without requiring a second annotation for the subclass (which would lead to redundant documentation being generated). -- MOS_MIGRATED_REVID=135786137
* Make EvalUtils.getDataTypeNameFromClass() look for @SkylarkModules in parent ↵Gravatar Jon Brandvein2016-10-05
| | | | | | | | | classes This is needed to let subclasses of @SkylarkModules have the same type() string as their superclass, without requiring a second annotation for the subclass (which would lead to redundant documentation being generated). -- MOS_MIGRATED_REVID=135161653
* Make SkylarkClassObject "Bazel-specific".Gravatar Dmitry Lomov2016-08-05
| | | | | | | This in preparation to DeclaredProviders implementation. -- MOS_MIGRATED_REVID=129420617
* Check that deeply nested values in sets are immutableGravatar Jon Brandvein2016-08-04
| | | | | -- MOS_MIGRATED_REVID=129331086
* Simplify immutability testGravatar Jon Brandvein2016-07-29
| | | | | -- MOS_MIGRATED_REVID=128800280
* Reinstate mutable maps, again.Gravatar Francois-Rene Rideau2016-02-17
| | | | | -- MOS_MIGRATED_REVID=114860576
* Rollback of commit f941d56acfad5f8c819c81b494f806ea74ea7fd8.Gravatar Carmi Grushko2016-02-02
| | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks many targets, see [] *** Original change description *** Reinstate mutable SkylarkDict Add <String, Object> annotation to optionMap invocation in SkylarkAttr, to make JDK 1.7 happy. Give the visible name "aspect" to class SkylarkAspect. -- MOS_MIGRATED_REVID=113543873
* Reinstate mutable SkylarkDictGravatar Francois-Rene Rideau2016-02-01
| | | | | | | | | | Add <String, Object> annotation to optionMap invocation in SkylarkAttr, to make JDK 1.7 happy. Give the visible name "aspect" to class SkylarkAspect. -- MOS_MIGRATED_REVID=113394826
* Rollback of commit c0a8c58b9230a1f5d76269eb7dc6b11e18f19686.Gravatar Damien Martin-Guillerez2016-01-29
| | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Break Java 1.7 builds of Bazel. See http://ci.bazel.io/job/Bazel/JAVA_VERSION=1.7,PLATFORM_NAME=linux-x86_64/327/console Test: git clone ... && git revert c0a8c58 && export JAVA_VERSION=1.7 && export BAZEL_COMPILE_TARGET=compile && bash -c "source scripts/ci/build.sh; bazel_build" *** Original change description *** Make Skylark dicts mutable Represent Skylark dict using a new subclass SkylarkDict<K, V> of Map<K, V>. Back it with a TreeMap to provide a deterministic iteration order. Also make SkylarkList generic in its element type <E>. Have Artifact implement Comparable<Object> so it can be used as TreeMap key. -- MOS_MIGRATED_REVID=113359718
* Make Skylark dicts mutableGravatar Francois-Rene Rideau2016-01-29
| | | | | | | | | | Represent Skylark dict using a new subclass SkylarkDict<K, V> of Map<K, V>. Back it with a TreeMap to provide a deterministic iteration order. Also make SkylarkList generic in its element type <E>. Have Artifact implement Comparable<Object> so it can be used as TreeMap key. -- MOS_MIGRATED_REVID=113277489
* Make SkylarkList a List.Gravatar Francois-Rene Rideau2016-01-22
| | | | | | | | | | | | | | | SkylarkList now implements the List interfaces, except that its mutating methods throw an UnsupportedOperationException, just like ImmutableList does. To actually mutate a SkylarkList, you need to pass a Location and a suitable Environment object with a matching Mutability while it is still active. Introduce SkylarkMutable and SkylarkMutable.MutableCollection to better handle mutable data structures. Remove some functions in EvalUtils made obsolete by this and previous changes regarding Skylark lists. -- MOS_MIGRATED_REVID=112768457
* Skylark: implemented all() and any()Gravatar Florian Weikert2015-12-16
| | | | | -- MOS_MIGRATED_REVID=110348607
* Replace "Google Inc" with "The Bazel Authors" in every copyright notice.Gravatar Lukacs Berki2015-10-21
| | | | | -- MOS_MIGRATED_REVID=105949508
* Separate build-specific types and types inherent to Skylark.Gravatar Lukacs Berki2015-09-21
| | | | | -- MOS_MIGRATED_REVID=103374106
* Parse the label syntax "@//a:b" so that eventually we can make that the ↵Gravatar Lukacs Berki2015-09-15
| | | | | | | | | syntax that means "refer to the main repository". There isn't an overarching plan for what we are going to do with the cmdline package, which seems to be separated from the .syntax one in all sorts of awkward ways. -- MOS_MIGRATED_REVID=103088960
* Move global objects to RuntimeGravatar Francois-Rene Rideau2015-08-31
| | | | | | | | Move away global constants and global namespaces out of Environment and into a new file Runtime. -- MOS_MIGRATED_REVID=101940218
* Changes related to the order of Skylark dictionaries:Gravatar Florian Weikert2015-08-04
| | | | | | | | | - Objects of different types can now be compared. - Printer now prints dictionaries in a deterministic order, even when the keys have different types. - testEval() in EvaluationTestCases evaluates both expressions instead of comparing expression strings. Consequently, if a statement describes a collection, its order does no longer matter when doing the comparison. -- MOS_MIGRATED_REVID=99829458
* Implement Skylark function reprGravatar Francois-Rene Rideau2015-06-15
| | | | | | | | | | | | | | | | | Move printing code from EvalUtils to Printer. Rename functions in Printer: printValue becomes str or print, prettyPrintValue becomes repr or write, formatString becomes format, makeFormattable becomes strFormattable, prettyPrintValues becomes listString. write being self-sufficient is made the reference, and print is the one that is a wrapper around write, rather than the other way around, avoiding mutual recursion. -- MOS_MIGRATED_REVID=95897834
* Skylark: fix escaping of backslashGravatar Francois-Rene Rideau2015-06-08
| | | | | | | | | | | Create a Printer class into which to eventually move all printing infrastructure currently in EvalUtils. For now, only move string escaping there. Fix the forgotten case of backslash. Allow any style of Python quotes, while we're at it, but keep using simple double-quote as the default. -- MOS_MIGRATED_REVID=95328052
* Skylark: type of None is NoneType (instead of None), for consistency with ↵Gravatar Laurent Le Brun2015-05-08
| | | | | | | Python. -- MOS_MIGRATED_REVID=93120393
* Some more cleanup.Gravatar Ulf Adams2015-03-10
| | | | | -- MOS_MIGRATED_REVID=87942730
* Description redacted.Gravatar Nathan Harmata2015-03-05
| | | | | -- MOS_MIGRATED_REVID=87698104
* Minor cleanups in SkylarkGravatar Francois-Rene Rideau2015-03-05
| | | | | -- MOS_MIGRATED_REVID=87535290
* Fix race condition in SkylarkType.ofGravatar Francois-Rene Rideau2015-03-05
| | | | | | | | | | | Fix race condition in SkylarkType.of(), whereby .equals() but not same (==) types were created, by making Simple.of() synchronized. Also make SkylarkType#includes() more robust by using .equals() instead of == (it's a little bit slower in the case of Simple types once fixed, but also works on complex types that don't hash-cons their values). Also, distinguish SkylarkList (printed as list) and java.util.List (printed as List) and similarly for tuple vs Tuple, when printing types in debugging messages. -- MOS_MIGRATED_REVID=87490176
* Update syntax tests to JUnit4.Gravatar Han-Wen Nienhuys2015-02-26
| | | | | -- MOS_MIGRATED_REVID=87248208
* Open source all the tests under lib/syntax/.Gravatar Ulf Adams2015-02-26
-- MOS_MIGRATED_REVID=87244284