Skip to content
Permalink
Browse files

Updated ScalaTest 3.1.0

  • Loading branch information
kiroco12 committed Dec 4, 2019
1 parent 8618792 commit 9023eba8174aeaf8b6043a8fee04511195fc4e85
Showing with 136 additions and 74 deletions.
  1. +2 −1 build.sbt
  2. +2 −1 project/ProjectPlugin.scala
  3. +3 −2 src/main/scala/stdlib/Asserts.scala
  4. +6 −2 src/main/scala/stdlib/ByNameParameter.scala
  5. +3 −2 src/main/scala/stdlib/CaseClasses.scala
  6. +3 −2 src/main/scala/stdlib/Classes.scala
  7. +3 −2 src/main/scala/stdlib/EmptyValues.scala
  8. +3 −2 src/main/scala/stdlib/Enumerations.scala
  9. +3 −2 src/main/scala/stdlib/Extractors.scala
  10. +6 −2 src/main/scala/stdlib/ForExpressions.scala
  11. +3 −2 src/main/scala/stdlib/Formatting.scala
  12. +3 −2 src/main/scala/stdlib/HigherOrderFunctions.scala
  13. +3 −2 src/main/scala/stdlib/Implicits.scala
  14. +3 −2 src/main/scala/stdlib/InfixPrefixandPostfixOperators.scala
  15. +3 −2 src/main/scala/stdlib/InfixTypes.scala
  16. +3 −2 src/main/scala/stdlib/Iterables.scala
  17. +3 −2 src/main/scala/stdlib/Lists.scala
  18. +6 −2 src/main/scala/stdlib/LiteralBooleans.scala
  19. +6 −2 src/main/scala/stdlib/LiteralNumbers.scala
  20. +6 −2 src/main/scala/stdlib/LiteralStrings.scala
  21. +3 −2 src/main/scala/stdlib/Maps.scala
  22. +3 −2 src/main/scala/stdlib/NamedandDefaultArguments.scala
  23. +3 −2 src/main/scala/stdlib/Objects.scala
  24. +3 −2 src/main/scala/stdlib/Options.scala
  25. +3 −2 src/main/scala/stdlib/ParentClasses.scala
  26. +6 −2 src/main/scala/stdlib/PartialFunctions.scala
  27. +3 −2 src/main/scala/stdlib/PartiallyAppliedFunctions.scala
  28. +6 −2 src/main/scala/stdlib/PatternMatching.scala
  29. +3 −2 src/main/scala/stdlib/Ranges.scala
  30. +3 −2 src/main/scala/stdlib/RepeatedParameters.scala
  31. +3 −2 src/main/scala/stdlib/SequencesandArrays.scala
  32. +3 −2 src/main/scala/stdlib/Sets.scala
  33. +3 −2 src/main/scala/stdlib/Traits.scala
  34. +3 −2 src/main/scala/stdlib/Traversables.scala
  35. +3 −2 src/main/scala/stdlib/Tuples.scala
  36. +6 −2 src/main/scala/stdlib/TypeSignatures.scala
  37. +3 −2 src/main/scala/stdlib/TypeVariance.scala
  38. +3 −2 src/main/scala/stdlib/UniformAccessPrinciple.scala
@@ -13,7 +13,8 @@ lazy val stdlib = (project in file("."))
%%("shapeless", V.shapeless),
%%("scalatest", V.scalatest),
%%("scalacheck", V.scalacheck),
"com.github.alexarchambault" %% "scalacheck-shapeless_1.14" % V.scalacheckShapeless
"com.github.alexarchambault" %% "scalacheck-shapeless_1.14" % V.scalacheckShapeless,
"org.scalatestplus" %% "scalatestplus-scalacheck" % V.scalatestplusScheck
)
)

@@ -18,7 +18,8 @@ object ProjectPlugin extends AutoPlugin {
lazy val V = new {
val scala212: String = "2.12.10"
val shapeless: String = "2.3.3"
val scalatest: String = "3.0.8"
val scalatest: String = "3.1.0"
val scalatestplusScheck: String = "3.1.0.0-RC2"
val scalacheck: String = "1.14.2"
val scalacheckShapeless: String = "1.2.3"
}
@@ -6,11 +6,12 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name asserts
*/
object Asserts extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object Asserts extends AnyFlatSpec with Matchers with org.scalaexercises.definitions.Section {

/** ScalaTest makes three assertions available by default in any style trait. You can use:
*
@@ -6,11 +6,15 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name byname_parameter
*/
object ByNameParameter extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object ByNameParameter
extends AnyFlatSpec
with Matchers
with org.scalaexercises.definitions.Section {

/** `() => Int` is a Function type that takes a `Unit` type. `Unit` is known as `void` to a Java programmer. The function returns an `Int`. You can place this as a method parameter so that you can you use it as a block, but still it doesn't look quite right:
*/
@@ -6,11 +6,12 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name case_classes
*/
object CaseClasses extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object CaseClasses extends AnyFlatSpec with Matchers with org.scalaexercises.definitions.Section {

/** Scala supports the notion of ''case classes''. Case classes are regular classes which export their constructor parameters and which provide a recursive decomposition mechanism via pattern matching.
*
@@ -6,11 +6,12 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name classes
*/
object Classes extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object Classes extends AnyFlatSpec with Matchers with org.scalaexercises.definitions.Section {

/** Classes in Scala are static templates that can be instantiated into many objects at runtime.
* Here is a class definition which defines a class Point:
@@ -6,12 +6,13 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name empty_values
*
*/
object EmptyValues extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object EmptyValues extends AnyFlatSpec with Matchers with org.scalaexercises.definitions.Section {

/** ==null==
*
@@ -6,12 +6,13 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name enumerations
*
*/
object Enumerations extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object Enumerations extends AnyFlatSpec with Matchers with org.scalaexercises.definitions.Section {

/** To create an enumeration, create an object that extends the abstract class `Enumeration`, and set a `val` variable to the method `Value`. This is a trick to give values to each `val`.
*
@@ -6,12 +6,13 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name extractors
*
*/
object Extractors extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object Extractors extends AnyFlatSpec with Matchers with org.scalaexercises.definitions.Section {

/** In Scala, patterns can be defined independently of case classes. To this end, a method named `unapply` is defined to yield a so-called extractor.
*
@@ -6,12 +6,16 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name for_expressions
*
*/
object ForExpressions extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object ForExpressions
extends AnyFlatSpec
with Matchers
with org.scalaexercises.definitions.Section {

/** `for` expressions can nest, with later generators varying more rapidly than earlier ones:
*/
@@ -6,12 +6,13 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name formatting
*
*/
object Formatting extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object Formatting extends AnyFlatSpec with Matchers with org.scalaexercises.definitions.Section {

/** String can be placed in format:
*/
@@ -6,13 +6,14 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name higher_order_functions
*
*/
object HigherOrderFunctions
extends FlatSpec
extends AnyFlatSpec
with Matchers
with org.scalaexercises.definitions.Section {

@@ -6,13 +6,14 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import scala.language.implicitConversions

/** @param name implicits
*
*/
object Implicits extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object Implicits extends AnyFlatSpec with Matchers with org.scalaexercises.definitions.Section {

/** The actual arguments that are eligible to be passed to an implicit parameter fall into two categories:
*
@@ -6,14 +6,15 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import scala.language.postfixOps

/** @param name infix_prefix_and_postfix_operators
*
*/
object InfixPrefixandPostfixOperators
extends FlatSpec
extends AnyFlatSpec
with Matchers
with org.scalaexercises.definitions.Section {

@@ -6,12 +6,13 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name infix_types
*
*/
object InfixTypes extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object InfixTypes extends AnyFlatSpec with Matchers with org.scalaexercises.definitions.Section {

/** An infix type `T1 op T2` consists of an infix operator `op` which gets applied to two
* type operands `T1` and `T2`. The type is equivalent to the type application `op[T1,T2]`.
@@ -6,12 +6,13 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name iterables
*
*/
object Iterables extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object Iterables extends AnyFlatSpec with Matchers with org.scalaexercises.definitions.Section {

/** The next trait from the top in the collections hierarchy is `Iterable`. All methods in this trait are defined in terms of an abstract method, `iterator`, which yields the collection's elements one by one. The `foreach` method from trait `Traversable` is implemented in `Iterable` in terms of `iterator`. Here is the actual implementation:
*
@@ -6,12 +6,13 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name lists
*
*/
object Lists extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object Lists extends AnyFlatSpec with Matchers with org.scalaexercises.definitions.Section {

/** Scala Lists are quite similar to arrays, which means all the elements of a list have the same type - but there are two important differences. First, lists are immutable, which means elements of a list cannot be changed by assignment. Second, lists represent a linked list whereas arrays are flat. The type of a list that has elements of type `T` is written as `List[T]`.
*
@@ -6,12 +6,16 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name literal_booleans
*
*/
object LiteralBooleans extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object LiteralBooleans
extends AnyFlatSpec
with Matchers
with org.scalaexercises.definitions.Section {

/** Boolean literals are either true or false, using the `true` or `false` keyword:
*/
@@ -6,12 +6,16 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name literal_numbers
*
*/
object LiteralNumbers extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object LiteralNumbers
extends AnyFlatSpec
with Matchers
with org.scalaexercises.definitions.Section {

/** Integer literals are 32-bit and can be created from decimals as well as hexadecimals:
*/
@@ -6,12 +6,16 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name literal_strings
*
*/
object LiteralStrings extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object LiteralStrings
extends AnyFlatSpec
with Matchers
with org.scalaexercises.definitions.Section {

/** Character literals are quoted with single quotes:
*/
@@ -6,12 +6,13 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name maps
*
*/
object Maps extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object Maps extends AnyFlatSpec with Matchers with org.scalaexercises.definitions.Section {

/** A `Map` is an `Iterable` consisting of pairs of keys and values (also named mappings or associations). Scala's Predef class offers an implicit conversion that lets you write `key -> value` as an alternate syntax for the pair `(key, value)`. For instance `Map("x" -> 24, "y" -> 25, "z" -> 26)` means exactly the same as `Map(("x", 24), ("y", 25), ("z", 26))`, but reads better.
*
@@ -7,13 +7,14 @@
package stdlib

import NamedandDefaultArgumentsHelper._
import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name named_and_default_arguments
*
*/
object NamedandDefaultArguments
extends FlatSpec
extends AnyFlatSpec
with Matchers
with org.scalaexercises.definitions.Section {

@@ -6,12 +6,13 @@

package stdlib

import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name objects
*
*/
object Objects extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object Objects extends AnyFlatSpec with Matchers with org.scalaexercises.definitions.Section {

/** An object is a singleton. One object, that's it. This object is a replacement of static in Java, and is called upon much in the same way:
*/
@@ -7,12 +7,13 @@
package stdlib

import OptionsHelper._
import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

/** @param name options
*
*/
object Options extends FlatSpec with Matchers with org.scalaexercises.definitions.Section {
object Options extends AnyFlatSpec with Matchers with org.scalaexercises.definitions.Section {

/** If you have worked with Java at all in the past, it is very likely that you have come across a `NullPointerException` at some time (other languages will throw similarly named errors in such a case). Usually this happens because some method returns null when you were not expecting it and thus not dealing with that possibility in your client code. A value of `null` is often abused to represent an absent optional value.
*

0 comments on commit 9023eba

Please sign in to comment.
You can’t perform that action at this time.