ScalaTest/Scalactic 3.1.0 Draft Release Notes

ScalaTest/Scalactic 3.1.0 (for Scala 2.10, 2.11, 2.12, and 2.13; on the JVM, JavaScript, native, and Dotty) includes the enhancements and bug fixes listed below. No source code using ScalaTest/Scalactic 3.0.8 should break, other than expired deprecations, but because this release is not binary compatible with 3.0.8, you will likely need to do a clean build to upgrade.

For information on how to include ScalaTest in your project, see the install page. For information on how to use Scalactic in your production code, see its install page.



ScalaTest


The major new feature of ScalaTest 3.1.0 is modularity. Anything involving third party integrations has been moved to an org.scalatestplus package. For example, ScalaCheck integration has been moved to the org.scalatestplus.scalacheck package. These integration artifacts can now evolve independently, which allows them to more easily track updates in the third party libraries as well as in ScalaTest.

We have also performed deprecations in ScalaTest 3.1.0 to prepare to modularize internally in our next release, 3.2.0. In addition to releasing the customary monolithic scalatest artifact that contains everything in the library, as of 3.2.0 we will also release more focused artifacts, such as scalatest-funsuite. If you add a dependency on scalatest-funsuite in your project's build, members of your team will only be able to use the FunSuite style. Any attempts to use other styles, such as FlatSpec or FeatureSpec, will not compile in that project unless the build file is changed.

The purpose of the internal modularization is to help teams maintain style consistency across a project when using ScalaTest. Although the user guide recommends that testing styles be chosen on a per-project or per-team basis, it has been easy for individual developers to use different styles in the same project.

We also performed deprecations in 3.1.0 to prepare to modularize assertion styles in 3.2.0. All artifacts in 3.2.0 will include ScalaTest's basic assertions, but if you use a focused module like scalatest-funsuite, your team will only be able to use ScalaTest's basic assertions unless you add another dependency. If you want to use matchers, for example, you would add either scalatest-shouldmatchers (if you prefer should) or scalatest-mustmatchers (if you prefer must). If you add the former, your team will be able to write matcher expressions with should, but not must, unless the build is changed. Similarly, if you want to use diagrammed assertions (now called Diagrams) on your project, you would add a dependency to scalatest-diagrams.

Modularization required that we rename many traits, classes, and objects so that all the members of each package would belong to a single module. In the monolithic ScalaTest artifact, which everyone is currently using in their build, the old names are deprecated and will continue to work in 3.1.0. To upgrade to 3.1.0, we recommend that you first upgrade to 3.0.8 and clear all deprecation warnings. We offer a ScalaFix tool to help you fix the 3.0.8 deprecation warnings. Then, just change the version to 3.1.0. Your project should compile as before, but you'll get deprecation warnings about the name changes. To help you with all the renames, we are providing a ScalaFix tool to help you fix the 3.1.0 deprecation warnings.

The previous mechanism for encouraging style consistency across a codebase, "chosen styles," has been deactivated in 3.1.0. ScalaTest will continue to accept chosen styles configuration (given with -y) during a long deprecation period, but such configuration will no longer have any effect.

Bug Fixes

  • Fixed a macro-based assertion problem when it was used directly with the package name without mixing in or import the trait.
  • Fixed a race condition causing occasional ConcurrentModificationException when executing async styles with a non-default execution context on the JVM. (PR #1628)
  • Made is pending work in AsyncFreeSpec, AsyncFlatSpec, AsyncWordSpec. (PR #1628)
  • Refactored the implementation of CompositeStatus to eliminate a leak of the this reference in the constructor.

Improvements

  • Changed feature to Feature and scenario to Scenario in FeatureSpec. Deprecated the lowercase versions. This change will make FeatureSpec syntax more consistent internally. Originally the GivenWhenThen trait offered given, when, and then methods (i.e., with lowercase names). When Scala deprecated then, to reclaim then as a potential future Scala language keyword, we capitalized GivenWhenThen's method names. Capitalizing Feature and Scenario makes these method names more consistent with the previously capitalized Given, When, and Then methods. In addition, capitalizing Feature and Scenario makes FeatureSpec consistent with Cucumber and Gherkin, and internally consistent with the capitalized form of these words that have always been shown in ScalaTest's reports.
  • Added asynchronous support to Inspectors. If the result type of the body is Future[Assertion], the result type of the entire expression will be Future[Assertion].
  • Added asynchronous support to TableAsserting. If the result type of the body is Future[Assertion], the result type of the entire expression will be Future[Assertion].
  • Added asynchronous support to WheneverAsserting. If the result type of the body is Future[Assertion], the result type of the entire expression will be Future[Assertion].
  • Added JSON support to events and StringReporter.
  • Added asynchronous support to Eventually, by factoring out the retry behavior to a Retrying typeclass. If the result type of the body is Future[Assertion], the result type of the entire expression will be Future[Assertion].
  • Enhanced WebBrowser's isInputField method to handle element has attribute 'type' value returns null as 'text' type.
  • Enhanced WebBrowser's value_= method to execute JavaScript to set the value when the driver being used is JavaScriptExecutor.
  • Added a toDir method to WebBrowser.
  • Stopped using .toLowerCase when looking at the value of the environment variable for filling file pathnames. It now looks for the value "yes", not "true".
  • Removed an unnecessary nested synchronized call in SuiteSortingReporter.
  • Made MessageRecorder thread-safe.
  • Serialized the execution of scopes as well as tests within scopes when executing async styles. (PR #1628)
  • Changed how TestIgnored events are sent in async-style tests so that they are sent in order even under a non-default execution context (PR #1628).
  • Refactored the implementation of StatefulStatus to eliminate a potential race condition, despite not having evidence it ever caused a problem.
  • Ensured that if two threads call setCompleted concurrently on a StatefulStatus, the first thread will be allowed to execute all the callbacks in order while the second thread blocks. (PR #1628)
  • Changed isCompleted from parameterless to empty parens form, because it can observe a side effect. (PR #1628)
  • Clarified and improved Scaladoc for BeforeAndAfter, BeforeAndAfterEach, and BeforeAndAfterEachTestData traits, and the setCompleted method of StatefulStatus.
  • Added org.scalatest.TestsBeforeNestedSuites, which overrides run to invoke runTests before it invokes runNestedSuites. (The default behavior of run in Suite invokes runNestedSuites before invoking runTests.

Deprecations

  • Deprecated feature in favor of Feature in the FeatureSpec family of traits and classes.
  • Deprecated scenario in favor of Scenario in the FeatureSpec family of traits and classes.
  • Deprecated scenariosFor in favor of ScenariosFor in the FeatureSpec family of traits and classes.
  • Moved and renamed all of ScalaTest's style traits and classes so that we can modularize ScalaTest by style in 3.2.0. All style traits and classes for the FunSuite style, for example, have been moved to package org.scalatest.funsuite. The old names still work in 3.1.0, but have been deprecated.

    We also slightly renamed some of the traits and classes when we moved them. The main style traits and classes, whose test bodies have a result type of Any, have “Any” prefixed to their former simple names. For example, FunSuite has been renamed to AnyFunSuite in 3.1.0.

    The Any styles will be backwards compatible with ScalaTest's original style traits, which allow you to use assertions from any other testing library no matter the result type of those assertions. The reason for this name change is that in a future version of ScalaTest we plan to add a new set of style traits and classes with the original names, such as FunSuite (but in the org.scalatest.funsuite package), whose test bodies will have a result type of Assertion.

    In addition, the traits and classes in package org.scalatest.fixture have “Fixture” prefixed to their former simple names in their new location. For example, org.scalatest.fixture.FunSuite has been renamed to org.scalatest.funsuite.FixtureAnyFunSuite. Similarly, the traits and classes in package org.scalatest.path have “Path” prefixed to their former simple names in their new location. For example, org.scalatest.path.FunSpec has been renamed to org.scalatest.funsuite.PathAnyFunSpec.

    Here are the details:

    FunSuite style
    old name new name
    org.scalatest.FunSuite org.scalatest.funsuite.AnyFunSuite
    org.scalatest.FunSuiteLike org.scalatest.funsuite.AnyFunSuiteLike
    org.scalatest.AsyncFunSuite org.scalatest.funsuite.AsyncFunSuite
    org.scalatest.AsyncFunSuiteLike org.scalatest.funsuite.AsyncFunSuiteLike
    org.scalatest.fixture.FunSuite org.scalatest.funsuite.FixtureAnyFunSuite
    org.scalatest.fixture.FunSuiteLike org.scalatest.funsuite.FixtureAnyFunSuiteLike
    org.scalatest.fixture.AsyncFunSuite org.scalatest.funsuite.FixtureAsyncFunSuite
    org.scalatest.fixture.AsyncFunSuiteLike org.scalatest.funsuite.FixtureAsyncFunSuiteLike

    FlatSpec style
    old name new name
    org.scalatest.FlatSpec org.scalatest.flatspec.AnyFlatSpec
    org.scalatest.FlatSpecLike org.scalatest.flatspec.AnyFlatSpecLike
    org.scalatest.AsyncFlatSpec org.scalatest.flatspec.AsyncFlatSpec
    org.scalatest.AsyncFlatSpecLike org.scalatest.flatspec.AsyncFlatSpecLike
    org.scalatest.fixture.FlatSpec org.scalatest.flatspec.FixtureAnyFlatSpec
    org.scalatest.fixture.FlatSpecLike org.scalatest.flatspec.FixtureAnyFlatSpecLike
    org.scalatest.fixture.AsyncFlatSpec org.scalatest.flatspec.FixtureAsyncFlatSpec
    org.scalatest.fixture.AsyncFlatSpecLike org.scalatest.flatspec.FixtureAsyncFlatSpecLike

    FunSpec style
    old name new name
    org.scalatest.FunSpec org.scalatest.funspec.AnyFunSpec
    org.scalatest.FunSpecLike org.scalatest.funspec.AnyFunSpecLike
    org.scalatest.AsyncFunSpec org.scalatest.funspec.AsyncFunSpec
    org.scalatest.AsyncFunSpecLike org.scalatest.funspec.AsyncFunSpecLike
    org.scalatest.fixture.FunSpec org.scalatest.funspec.FixtureAnyFunSpec
    org.scalatest.fixture.FunSpecLike org.scalatest.funspec.FixtureAnyFunSpecLike
    org.scalatest.fixture.AsyncFunSpec org.scalatest.funspec.FixtureAsyncFunSpec
    org.scalatest.fixture.AsyncFunSpecLike org.scalatest.funspec.FixtureAsyncFunSpecLike
    org.scalatest.path.FunSpec org.scalatest.funspec.PathAnyFunSpec
    org.scalatest.path.FunSpecLike org.scalatest.funspec.PathAnyFunSpecLike

    WordSpec style
    old name new name
    org.scalatest.WordSpec org.scalatest.wordspec.AnyWordSpec
    org.scalatest.WordSpecLike org.scalatest.wordspec.AnyWordSpecLike
    org.scalatest.AsyncWordSpec org.scalatest.wordspec.AsyncWordSpec
    org.scalatest.AsyncWordSpecLike org.scalatest.wordspec.AsyncWordSpecLike
    org.scalatest.fixture.WordSpec org.scalatest.wordspec.FixtureAnyWordSpec
    org.scalatest.fixture.WordSpecLike org.scalatest.wordspec.FixtureAnyWordSpecLike
    org.scalatest.fixture.AsyncWordSpec org.scalatest.wordspec.FixtureAsyncWordSpec
    org.scalatest.fixture.AsyncWordSpecLike org.scalatest.wordspec.FixtureAsyncWordSpecLike

    FreeSpec style
    old name new name
    org.scalatest.FreeSpec org.scalatest.freespec.AnyFreeSpec
    org.scalatest.FreeSpecLike org.scalatest.freespec.AnyFreeSpecLike
    org.scalatest.AsyncFreeSpec org.scalatest.freespec.AsyncFreeSpec
    org.scalatest.AsyncFreeSpecLike org.scalatest.freespec.AsyncFreeSpecLike
    org.scalatest.fixture.FreeSpec org.scalatest.freespec.FixtureAnyFreeSpec
    org.scalatest.fixture.FreeSpecLike org.scalatest.freespec.FixtureAnyFreeSpecLike
    org.scalatest.fixture.AsyncFreeSpec org.scalatest.freespec.FixtureAsyncFreeSpec
    org.scalatest.fixture.AsyncFreeSpecLike org.scalatest.freespec.FixtureAsyncFreeSpecLike
    org.scalatest.path.FreeSpec org.scalatest.freespec.PathAnyFreeSpec
    org.scalatest.path.FreeSpecLike org.scalatest.freespec.PathAnyFreeSpecLike

    PropSpec style
    old name new name
    org.scalatest.PropSpec org.scalatest.propspec.AnyPropSpec
    org.scalatest.PropSpecLike org.scalatest.propspec.AnyPropSpecLike
    org.scalatest.AsyncPropSpec org.scalatest.propspec.AsyncPropSpec
    org.scalatest.AsyncPropSpecLike org.scalatest.propspec.AsyncPropSpecLike
    org.scalatest.fixture.PropSpec org.scalatest.propspec.FixtureAnyPropSpec
    org.scalatest.fixture.PropSpecLike org.scalatest.propspec.FixtureAnyPropSpecLike
    org.scalatest.fixture.AsyncPropSpec org.scalatest.propspec.FixtureAsyncPropSpec
    org.scalatest.fixture.AsyncPropSpecLike org.scalatest.propspec.FixtureAsyncPropSpecLike

    FeatureSpec style
    old name new name
    org.scalatest.FeatureSpec org.scalatest.featurespec.AnyFeatureSpec
    org.scalatest.FeatureSpecLike org.scalatest.featurespec.AnyFeatureSpecLike
    org.scalatest.AsyncFeatureSpec org.scalatest.featurespec.AsyncFeatureSpec
    org.scalatest.AsyncFeatureSpecLike org.scalatest.featurespec.AsyncFeatureSpecLike
    org.scalatest.fixture.FeatureSpec org.scalatest.featurespec.FixtureAnyFeatureSpec
    org.scalatest.fixture.FeatureSpecLike org.scalatest.featurespec.FixtureAnyFeatureSpecLike
    org.scalatest.fixture.AsyncFeatureSpec org.scalatest.featurespec.FixtureAsyncFeatureSpec
    org.scalatest.fixture.AsyncFeatureSpecLike org.scalatest.featurespec.FixtureAsyncFeatureSpecLike

  • Renamed a few top level traits that previously resided in the org.scalatest.fixture package. Given the actual fixture styles were moved from this package, it made more sense for these to reside in org.scalatest. Here are the details:

    top-level fixture traits
    old name new name
    org.scalatest.fixture.Suite org.scalatest.FixtureSuite
    org.scalatest.fixture.TestSuite org.scalatest.FixtureTestSuite
    org.scalatest.fixture.AsyncTestSuite org.scalatest.FixtureAsyncTestSuite
    org.scalatest.fixture.TestRegistration org.scalatest.FixtureTestRegistration
    org.scalatest.fixture.AsyncTestRegistration org.scalatest.FixtureAsyncTestRegistration
  • Moved and renamed matchers and diagrammed assertions traits and objects in 3.1.0 so that we can modularize ScalaTest by assertion style in 3.2.0. All of the old names still work but have been deprecated. Here are the details:

    Assertion style
    old name new name
    org.scalatest.Matchers org.scalatest.matchers.should.Matchers
    org.scalatest.MustMatchers org.scalatest.matchers.must.Matchers
    org.scalatest.DiagrammedAssertions org.scalatest.diagrams.Diagrams

  • To facilate modularization of matchers, moved org.scalatest.words members that were only needed by matchers to org.scalatest.matchers.dsl. Moved remaining members of words to org.scalatest.verbs. Deprecated the old names.

    These types were used internally to support DSLs, so most likely these name changes will not affect many users (if any). One other goal besides moving code that is only needed by matchers into the matchers module was to eliminate a competing package name (i.e., words) that starts the same as wordspec, which is a new package name in 3.1.0. Someone using wordspec would otherwise need to type more letters before code completion would give them wordspec.

Deprecation Expirations

  • In 3.0.8 we moved Checkers under org.scalatest.prop to org.scalatestplus.scalacheck package, and deprecated Checkers under org.scalatest.prop. Checkers was still released in the ScalaTest artifact, with the org.scalatestplus.scalacheck package name. In 3.1.0, we are removing the deprecated name and the actual implementation in the new package from the ScalaTest artifact. From now on these will be released as a separate, optional module to allow ScalaTest and its ScalaCheck integration library to evolve more independently.
  • Removed the deprecated trap method from trait Assertions, and with it, the NormalResult case class in the Assertions companion object.
  • Removed the deprecated, parameterless execute method. Please use the no-arg form, execute(), instead.
  • Removed a deprecated implicit conversion that was added in ScalaTest 3.0.0 because the inheritance relationship between Filter and Function2[Set[String], Map[String, Set[String]], List[(String, Boolean)]] had been dropped. Please use the apply method that takes a suiteId instead, the one with this signature: def apply(testNames: Set[String], testTags: Map[String, Set[String]], suiteId: String): List[(String, Boolean)].
  • Removed the deprecated, overloaded thread method in Conductors and ConductorMethods in package org.scalatest.concurrent that takes a string name. Please use threadNamed instead.
  • Removed the deprecated type alias in org.scalatest.concurrent for the old name of AsyncAssertions to the new name, Waiters. Also removed the entire package object, which would otherwise now be empty.
  • Removed the deprecated Interruptor, SelectorInterruptor, SocketInterruptor, and ThreadInterruptor classes and objects in the org.scalatest.concurrent package.
  • Removed the deprecated org.scalatest.concurrent.Timeouts trait. Please use org.scalatest.concurrent.TimeLimits instead.
  • Removed deprecated org.scalatest.concurrent.DeprecatedTimeLimitedTests.
  • Removed the deprecated name org.scalatest.PendingNothing. Use org.scalatest.PendingStatement instead.
  • Removed the deprecated org.scalatest.SpecLike type alias. Please use org.scalatest.refspec.RefSpecLike instead.
  • Removed the deprecated org.scalatest.Spec type alias. Please use org.scalatest.refspec.RefSpec instead.
  • Removed the deprecated org.scalatest.fixture.Spec class. Please use org.scalatest.funspec.FixtureFunSpec instead.
  • Removed the deprecated org.scalatest.fixture.SpecLike trait. Please use org.scalatest.funspec.FixtureFunSpecLike instead.


Scalactic


Improvements

  • Added new factory methods to the companion objects of existing anyvals (which also appear in the companions of new anyvals added in 3.1.0). The “existing anyvals” are those that appeared in the org.scalactic.anyvals package in version 3.0.0: PosInt, PosZInt, PosLong, PosZLong, PosFloat, PosZFloat, PosDouble, and PosZDouble:
    • ensuringValid - wraps a given value of the underlying type with an instance of a narrower anyvals type if it is valid, else throws AssertionError. ensuringValid factory methods is given in Bill Venners' in Hope, Faith, and Proof talk.
    • fromOrElse - wraps a given value of the underlying type with an instance of a narrower anyvals type if it is valid, else returns a given default.
    • goodOrElse - wraps a given value of the underlying type with an instance of a narrower anyvals type if it is valid, and returns that wrapped in a Good, else returns a Bad produced by passing the invalid value to a given function.
    • passOrElse - wraps a given value of the underlying type with an instance of a narrower anyvals type if it is valid, and returns that wrapped in a Pass, else returns a Fail produced by passing the invalid value to a given function.
    • rightOrElse - wraps a given value of the underlying type with an instance of a narrower anyvals type if it is valid, and returns that wrapped in a Right, else returns a Left produced by passing the invalid value to a given function.
    • tryingValid - wraps a given value of the underlying type with an instance of a narrower anyvals type if it is valid, and returns that wrapped in a Success, else returns a Failure containing an AssertionError.
  • Added an isValid predicate method to the companion objects of existing anyvals (which also appears in the companions of new anyvals added in 3.1.0) that returns true if a given value of the underlying type is valid.
  • Added an ensuringValid method to existing anyvals classes (i.e., different from the ensuringValid methods added to the companion objects), which passes the underlying value to a given function that produces another value of the underlying type, and wraps that result with the narrower anyvals type value if it is valid, else throws AssertionError. Background for the addition of these ensuringValid transformation methods is given in Bill Venners' in Hope, Faith, and Proof talk.
  • Added a plus method to class PosFloat, which takes a PosZFloat and returns the sum as a PosFloat. (The + methods on PosFloat return Float.)
  • Added a plus method to class PosZFloat, which takes a PosZFloat and returns the sum as a PosZFloat. (The + methods on PosZFloat return Float.)
  • Added a plus method to class PosDouble, which takes a PosZDouble and returns the sum as a PosDouble. (The + methods on PosDouble return Double.)
  • Added a plus method to class PosZDouble, which takes a PosZDouble and returns the sum as a PosZDouble. (The + methods on PosZDouble return Double.)
  • Thanks to Erik Osheim for pointing out that these plus methods are possible.
  • Added MinPositiveValue and PositiveInfinity methods to the companion objects for PosFloat, PosZFloat, PosDouble, and PosZDouble.
  • Added implicit widenToNonZeroDouble method to the companion objects for PosFloat and PosDouble.
  • Added implicit widenToNonZeroFloat method to the companion object for PosFloat.
  • Added implicit widenToNonZeroInt method to the companion object for PosInt.
  • Added implicit widenToNonZeroLong method to the companion object for PosInt.
  • Added implicit widenToNonZeroFloat method to the companion object for PosInt. This method is included despite the potential for loss of precision for consistency with Scala's implicit Int to Float conversion.
  • Added implicit widenToNonZeroDouble method to the companion object for PosInt.
  • Added implicit widenToNonZeroDouble method to the companion object for PosLong. This method is included despite the potential for loss of precision for consistency with Scala's implicit Long to Double conversion.
  • Added implicit widenToNonZeroFloat method to the companion object for PosLong. This method is included despite the potential for loss of precision for consistency with Scala's implicit Long to Float conversion.
  • Added implicit widenToNonZeroLong method to the companion object for PosLong.
  • Added the following new classes to the org.scalactic.anyvals package:
    • FiniteDouble - An AnyVal backed by a Double that can take any value except Double.PositiveInfinity, Double.NegativeInfinity, and Double.NaN.
    • FiniteFloat - An AnyVal backed by a Float that can take any value except Float.PositiveInfinity, Float.NegativeInfinity, and Float.NaN.
    • NegDouble - An AnyVal backed by a Double that can take any negative value. It cannot be zero, positive, or NaN, but it can be Double.NegativeInfinity.
    • NegFiniteDouble - An AnyVal backed by a Double that can take any negative value except Double.NegativeInfinity. It can also not be zero, positive, or NaN.
    • NegFiniteFloat - An AnyVal backed by a Float that can take any negative value except Float.NegativeInfinity. It can also not be zero, positive, or NaN.
    • NegFloat - An AnyVal backed by a Float that can take any negative value. It cannot be zero, positive, or NaN, but it can be Float.NegativeInfinity.
    • NegInt - An AnyVal backed by an Int that can take any negative value. It cannot be zero or positive.
    • NegLong - An AnyVal backed by an Long that can take any negative value. It cannot be zero or positive.
    • NegZDouble - An AnyVal backed by a Double that can take any negative value or zero. It cannot be positive or NaN, but it can be Double.NegativeInfinity.
    • NegZFiniteDouble - An AnyVal backed by a Double that can be zero or any negative value except Double.NegativeInfinity. It cannot be positive or NaN.
    • NegZFiniteFloat - An AnyVal backed by a Float that can be zero any negative value except Float.NegativeInfinity. It cannot be positive or NaN.
    • NegZFloat - An AnyVal backed by a Float that can take any negative value or zero. It cannot be positive or NaN, but it can be Float.NegativeInfinity.
    • NegInt - An AnyVal backed by an Int that can take any negative value or zero. It cannot be positive.
    • NegLong - An AnyVal backed by an Long that can take any negative value or zero. It cannot be positive.
    • NonEmptyArray - An AnyVal backed by an Array that contains one or more elements. It cannot be empty.
    • NonEmptyList - An AnyVal backed by a List that contains one or more elements. It cannot be empty. This was previously in the library in org.scalactic under the name Chain, which has been deprecated.
    • NonEmptyMap - An AnyVal backed by a Map that contains one or more key-value pairs. It cannot be empty.
    • NonEmptySet - An AnyVal backed by a Set that contains one or more elements. It cannot be empty.
    • NonEmptyString - An AnyVal backed by a String that contains one or more characters. It cannot be empty.
    • NonEmptyVector - An AnyVal backed by a Vector that contains one or more elements. It cannot be empty.
    • NonZeroDouble - An AnyVal backed by a Double that can take any value except zero or NaN. It can be Double.NegativeInfinity and Double.PositiveInfinity.
    • NonZeroFiniteDouble - An AnyVal backed by a Double that can take any value except zero, Double.NegativeInfinity, Double.PositiveInfinity, or NaN.
    • NonZeroFiniteFloat - An AnyVal backed by a Float that can take any value except zero, Float.NegativeInfinity, Float.PositiveInfinity, or NaN.
    • NonZeroFloat - An AnyVal backed by a Float that can take any value except zero or NaN. It can be Float.NegativeInfinity and Float.PositiveInfinity.
    • NonZeroInt - An AnyVal backed by an Int that can take any value except zero.
    • NonZeroLong - An AnyVal backed by an Long that can take any value except zero.
    • NumericChar - An AnyVal backed by a Char that can only have values '0' through '9'.
    • NumericString - An AnyVal backed by a String that can only contain characters with values '0' through '9'. It can also be empty.
    • PosFiniteDouble - An AnyVal backed by a Double that can take any positive value except Double.PositiveInfinity. It can also not be zero, negative, or NaN.
    • PosFiniteFloat - An AnyVal backed by a Float that can take any positive value except Float.PositiveInfinity. It can also not be zero, negative, or NaN.
    • PosZFiniteDouble - An AnyVal backed by a Double that can be zero or any positive value except Double.PositiveInfinity. It cannot be negative or NaN.
    • PosZFiniteFloat - An AnyVal backed by a Float that can be zero any positive value except Float.PositiveInfinity. It cannot be negative or NaN.
  • Used ensuringValid instead of from to produce an Option followed immediately by a get to extract from that Option in implementations of the anyvals methods.
  • Changed negation (unary_-) methods in anyvals to return another anyvals type, now that we have Neg* types in addition to Pos* types.

Deprecations

  • Deprecated org.scalactic.Chain, because it has been renamed to org.scalactic.anyvals.NonEmptyList to have consistent naming with the other newly added NonEmpty* anyvals types.


Visit ScalaTest Release Notes for links to the release notes of all previous versions, or step back in time by visiting the release notes for the previous version.

ScalaTest is brought to you by Bill Venners and Artima.
ScalaTest is free, open-source software released under the Apache 2.0 license.

If your company loves ScalaTest, please consider sponsoring the project.

Copyright © 2009-2019 Artima, Inc. All Rights Reserved.

artima