summaryrefslogtreecommitdiff
path: root/test/files/scalacheck
Commit message (Collapse)AuthorAgeFilesLines
* SI-6968 Simple Tuple patterns aren't irrefutableJason Zaugg2013-01-271-1/+1
| | | | | | | | | | | | Reverts part of c82ecab. The parser can't assume that a pattern `(a, b)` will match, as results of `.isInstanceOf[Tuple2]` can't be statically known until after the typer. The reopens SI-1336, SI-5589 and SI-4574, in exchange for fixing this regression SI-6968. Keeping all of those fixed will require a better definition of irrefutability, and some acrobatics to ensure safe passage to the ambiguous trees through typechecking.
* Merge pull request #1339 from rkuhn/wip-6389-finite-duration-multJosh Suereth2012-09-201-0/+69
|\ | | | | enable integer multiplication/divison on FiniteDuration, see SI-6389
| * move Duration (incl. DSL) into scala.concurrent.duration packageRoland2012-09-191-1/+1
| | | | | | | | | | | | | | | | | | so that the full package can be imported naturally: import scala.concurrent.duration._ will give you all the types (Duration, FiniteDuration, Deadline) and the DSL for constructing these.
| * improve performance of integer multiplication overflow check on DurationRoland2012-09-191-0/+69
| | | | | | | | | | - also rename divisor arguments to “divisor” - and add a scalacheck for multiplication overflow detection
* | Add RedBlackTree tests for take/drop/slice.Juha Heljoranta2012-09-181-0/+42
|/ | | | Addresses review feedback by axel22.
* Merge pull request #786 from axel22/issue/5986-cherryJosh Suereth2012-06-271-2/+2
|\ | | | | Fix SI-5986.
| * Fix SI-5986.Aleksandar Prokopec2012-06-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Here we had an issue that RedBlack does not work the same way for sets - which are not supposed to replace an element if it is the same (wrt equals) and maps - which should replace the corresponding values. Adding an overwrite parameter which decides whether to overwrite added keys if they are the same in the ordering. Fix tests.
* | Updated scalacheck sources.Paul Phillips2012-06-191-1/+0
|/ | | | | | | | | | | | | | | | | | | | | | | | | To current scalacheck head 7ffda752d8 except for this diff: diff -rw src/scalacheck/org/scalacheck/Arbitrary.scala /s/scalacheck/src/main/scala/org/scalacheck/Arbitrary.scala 13d12 < import scala.reflect.ClassTag 281c280 < implicit def arbArray[T](implicit a: Arbitrary[T], c: ClassTag[T] --- > implicit def arbArray[T](implicit a: Arbitrary[T], c: ClassManifest[T] diff -rw src/scalacheck/org/scalacheck/Prop.scala /s/scalacheck/src/main/scala/org/scalacheck/Prop.scala 63c63 < def mainCallsExit = false --- > def mainCallsExit = true Only in /s/scalacheck/src/main/scala/org/scalacheck: ScalaCheckFramework.scala diff -rw src/scalacheck/org/scalacheck/util/Buildable.scala /s/scalacheck/src/main/scala/org/scalacheck/util/Buildable.scala 13d12 < import scala.reflect.ClassTag 34c33 < implicit def buildableArray[T](implicit cm: ClassTag[T]) = --- > implicit def buildableArray[T](implicit cm: ClassManifest[T]) =
* removes array tagsEugene Burmako2012-06-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before 2.10 we had a notion of ClassManifest that could be used to retain erasures of abstract types (type parameters, abstract type members) for being used at runtime. With the advent of ClassManifest (and its subtype Manifest) it became possible to write: def mkGenericArray[T: Manifest] = Array[T]() When compiling array instantiation, scalac would use a ClassManifest implicit parameter from scope (in this case, provided by a context bound) to remember Ts that have been passed to invoke mkGenericArray and use that information to instantiate arrays at runtime (via Java reflection). When redesigning manifests into what is now known as type tags, we decided to explore a notion of ArrayTags that would stand for abstract and pure array creators. Sure, ClassManifests were perfectly fine for this job, but they did too much - technically speaking, one doesn't necessarily need a java.lang.Class to create an array. Depending on a platform, e.g. within JavaScript runtime, one would want to use a different mechanism. As tempting as this idea was, it has also proven to be problematic. First, it created an extra abstraction inside the compiler. Along with class tags and type tags, we had a third flavor of tags - array tags. This has threaded the additional complexity though implicits and typers. Second, consequently, when redesigning tags multiple times over the course of Scala 2.10.0 development, we had to carry this extra abstraction with us, which exacerbated the overall feeling towards array tags. Finally, array tags didn't fit into the naming scheme we had for tags. Both class tags and type tags sound logical, because, they are descriptors for the things they are supposed to tag, according to their names. However array tags are the odd ones, because they don't actually tag any arrays. As funny as it might sound, the naming problem was the last straw that made us do away with the array tags. Hence this commit.
* repairs the tests after the refactoring spreeEugene Burmako2012-06-081-1/+2
|
* resurrects manifests in their pre-2.10 gloryEugene Burmako2012-04-231-0/+37
|
* migrates stdlib and compiler to tagsEugene Burmako2012-04-231-5/+4
| | | | | * all usages of ClassManifest and Manifest are replaced with tags * all manifest tests are replaced with tag tests
* Merge remote-tracking branch 'axel22/feature/collection-concurrent' into developPaul Phillips2012-03-272-11/+11
|\
| * Rename ConcurrentTrieMap to concurrent.TrieMap.Aleksandar Prokopec2012-03-272-11/+11
| | | | | | | | | | | | | | | | Introduced the collection.concurrent package and introduced the concurrent.Map trait there. Deprecated the mutable.ConcurrentMap trait. Pending work - introduce the appropriate changes to JavaConversions and JavaConverters.
* | Regex improvementsDaniel C. Sobral2012-03-231-0/+32
|/ | | | | | | | | | | This adds findAllMatchIn to Regex to mirror other similar methods. It also overloads StringLike's "r", adding a version that accepts group names. It includes test cases for both methods. Closes SI-2460.
* Renaming Ctrie to ConcurrentTrieMap.Aleksandar Prokopec2012-03-163-14/+14
|
* Add tasksupport as a configurable field in parallel collections.Aleksandar Prokopec2012-02-231-1/+1
| | | | | | | | | This required a bit of refactoring in the tasks objects and implementations of various operations. Combiners now hold a reference to a tasksupport object and pass it on to their result if `resultWithTaskSupport` is called. Additionally, several bugs that have to do with CanBuildFrom and combiner resolution have been fixed.
* Merge remote-tracking branch 'erikrozendaal/SI-5331' into developPaul Phillips2012-02-154-32/+554
|\
| * Custom implementations of drop/take/slice.Erik Rozendaal2012-01-232-5/+31
| | | | | | | | This mainly helps performance when comparing keys is expensive.
| * Custom coded version of range/from/to/until.Erik Rozendaal2012-01-211-16/+10
| | | | | | | | | | This avoids unnecessary allocation of Option and Function objects, mostly helping performance of small trees.
| * Optimized implementation of TreeMap/TreeSet#to method.Erik Rozendaal2012-01-153-13/+54
| | | | | | | | Performance of `to` and `until` is now the same.
| * Test for maximum height of red-black tree.Erik Rozendaal2012-01-081-0/+5
| |
| * Fix silly copy-paste error.Erik Rozendaal2012-01-071-9/+9
| |
| * Tests for takeWhile/dropWhile/span.Erik Rozendaal2012-01-072-0/+30
| | | | | | | | Also simplified implementation of span to just use splitAt.
| * Renamed object RedBlack to RedBlackTree.Erik Rozendaal2012-01-072-56/+269
| | | | | | | | | | | | This more clearly separates the new implementation from the now deprecated abstract class RedBlack and avoids naming conflicts for the member classes.
| * Restore old RedBlack class to maintain backwards compatibility.Erik Rozendaal2012-01-061-28/+28
| | | | | | | | | | | | | | | | | | The class is marked as deprecated and no longer used by the TreeMap/TreeSet implementation but is restored in case it was used by anyone else (since it was not marked as private to the Scala collection library). Renamed RedBlack.{Tree,RedTree,BlackTree} to Node, RedNode, and BlackNode to work around name clash with RedBlack class.
| * Optimize foreach and iterators.Erik Rozendaal2012-01-042-0/+32
| |
| * Use null to represent empty trees. Removed Empty/NonEmpty classes.Erik Rozendaal2012-01-031-56/+56
| |
| * Added some tests for TreeMap/TreeSet.Erik Rozendaal2011-12-282-0/+182
| |
| * Made RedBlack private to the scala.collection.immutable package.Erik Rozendaal2011-12-281-6/+9
| | | | | | | | | | Use ArrayStack instead of Stack in TreeIterator for slightly increased performance.
| * Make sure the redblack test compiles and runs.Erik Rozendaal2011-12-281-40/+36
| |
* | Add tests for parallel Ctrie.Aleksandar Prokopec2012-02-033-9/+110
| | | | | | | | Changed parameters in some tests to speed them up.
* | Add the Ctrie concurrent map implementation.Aleksandar Prokopec2012-02-011-0/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | Ctrie is a scalable concurrent map implementation that supports constant time lock-free lazy snapshots. Due to the well-known private volatile field problem, atomic reference updaters cannot be used efficiently in Scala yet. For this reason, 4 java files had to be included as well. None of these pollute the namespace, as most of the classes are private. Unit tests and a scalacheck check is also included.
* | Merge pull request #1 from lpereir4/avlAleksandar Prokopec2012-01-301-0/+114
|\ \ | | | | | | AvlTree performance improvements
| * | Scalacheck test in order to ensure AVL invariants are respected.Lucien Pereira2012-01-281-0/+114
| | |
* | | Set fields in immutable hash maps and hash sets to vals.aleksandar2012-01-261-15/+15
|/ / | | | | | | | | | | | | | | | | | | This is part of an effort to make the immutable collections (more) thread safe. The `::` still has non-final member fields for head and tail, but there is not much that can be done right now about that, since these fields are used by list buffers. Tried writing a test with unsafe initialization, but could not invent a scenario which actually fails, at least on the JDK6.
* | Merge branch 'master' into issue/4147aleksandar2012-01-121-0/+130
|\| | | | | | | | | Conflicts: .gitignore
| * fixes #5104 and related NaN ordering inconsistenciesSzabolcs Berecz2011-12-251-0/+130
| | | | | | | | | | | | | | | | | | | | | | The bug was caused by the inconsistency between j.l.Math.min() and j.l.Double.compareTo() wrt NaN (j.l.Math.min() considers NaN to be less than any other value while j.l.Double.compareTo() says it's greater...) The fix changes Ordering.{FloatOrdering,DoubleOrdering) to base it's results on primitive comparisons and math.{min,max} instead of j.l.{Float,Double}.compareTo()
* | Add mutable tree sets to the standard library.aleksandar2012-01-121-0/+67
|/ | | | | | | This implementation is based on AVL trees. The current implementation is contributed by Lucien Pereira. Fixes #4147.
* Fixed scalacheck test to fail if it's failing.Paul Phillips2011-12-161-7/+1
|
* Improve quality of scalacheck range tests input and output.Daniel C. Sobral2011-12-161-26/+55
| | | | | | | Remove some dead code, activate ByOne generator again, add generators for inclusive ranges, add generators that concentrate on the boundaries, and add some print statements next to exceptions that might get eaten by out of memory errors.
* Re-enable RedBlack's ScalaCheck test, which was disabled at r21829.Daniel C. Sobral2011-12-011-0/+213
| | | | | | | | | | I haven't been able to find any reason for that reversal, but this version is an improved version provided with SI-3796, which never got committed along with the patch. This version generates trees directly instead of using the methods under test. It also puts an upper bound on tree size and, therefore, execution time.
* Begone t1737...Hubert Plociniczak2011-11-0223-207/+207
|
* Fix for unfortunate bug in Range.init.Paul Phillips2011-06-301-0/+7
|
* Fixed some tests, renamed from Any to Gen.Aleksandar Pokopec2011-04-131-3/+3
| | | | | No review.
* Refactoring the collections api to support diff...Aleksandar Pokopec2011-04-133-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactoring the collections api to support differentiation between referring to a sequential collection and a parallel collection, and to support referring to both types of collections. New set of traits Gen* are now superclasses of both their * and Par* subclasses. For example, GenIterable is a superclass of both Iterable and ParIterable. Iterable and ParIterable are not in a subclassing relation. The new class hierarchy is illustrated below (simplified, not all relations and classes are shown): TraversableOnce --> GenTraversableOnce ^ ^ | | Traversable --> GenTraversable ^ ^ | | Iterable --> GenIterable <-- ParIterable ^ ^ ^ | | | Seq --> GenSeq <-- ParSeq (the *Like, *View and *ViewLike traits have a similar hierarchy) General views extract common view functionality from parallel and sequential collections. This design also allows for more flexible extensions to the collections framework. It also allows slowly factoring out common functionality up into Gen* traits. From now on, it is possible to write this: import collection._ val p = parallel.ParSeq(1, 2, 3) val g: GenSeq[Int] = p // meaning a General Sequence val s = g.seq // type of s is Seq[Int] for (elem <- g) { // do something without guarantees on sequentiality of foreach // this foreach may be executed in parallel } for (elem <- s) { // do something with a guarantee that foreach is executed in order, sequentially } for (elem <- p) { // do something concurrently, in parallel } This also means that some signatures had to be changed. For example, method `flatMap` now takes `A => GenTraversableOnce[B]`, and `zip` takes a `GenIterable[B]`. Also, there are mutable & immutable Gen* trait variants. They have generic companion functionality.
* Implementing foreach to work in parallel in Par...Aleksandar Pokopec2011-03-224-4/+4
| | | | | | | | | | | | Implementing foreach to work in parallel in ParIterableLike. Doing a bunch of refactoring around in the collection framework to ensure a parallel foreach is never called with a side-effecting method. This still leaves other parts of the standard library and the compiler unguarded. No review.
* Fixes the broken test, introduced in the view p...Aleksandar Pokopec2011-03-111-8/+12
| | | | | | | Fixes the broken test, introduced in the view patch commit. No review.
* A patch for views. Most relevant change:Paul Phillips2011-03-111-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Almost all view classes now list parents like trait Appended[B >: A] extends super.Appended[B] with Transformed[B] instead of the former trait Appended[B >: A] extends Transformed[B] with super.Appended[B] because as it was, the implementation of foreach in TraversableViewLike#Transformed was repeatedly trumping overrides found in e.g. IterableLike. This change was not without its own consequences, and much of the rest of the patch is dealing with that. A more general issue is clearly revealed here: there is no straightforward way to deal with trait composition and overrides when some methods should prefer B over A and some the reverse. (It's more like A through Z in this case.) That closes #4279, with some views being five orders of magnitude slower than necessary. There is a test that confirms they'll stay performance neighbors. In the view classes (Zipped, Mapped, etc.) I attended to them with comb and brush until they were reasonably consistent. I only use "override" where necessary and throw in some "final" in the interests of trying to anchor the composition outcome. I also switched the newSliced, newZipped, etc. methods to use early init syntax since a number have abstract vals and I found at least one bug originating with uninitialized access. There was a piece of a parallel collections scalacheck test failing, which I disabled out of expedience - am emailing prokopec. There is plenty of work left to do but paulp must get back to other 2.9 issues. This is the Zurich->SF airplane patch. No review.
* Merge branch 'work'Aleksandar Pokopec2011-01-261-1/+1
| | | | | | Conflicts: src/library/scala/concurrent/SyncVar.scala