-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Expr.ExponentiateOutputs and unit tests (#67)
- Loading branch information
Showing
7 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
core/src/test/scala/vapors/interpreter/ExponentiateOutputsSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.rallyhealth | ||
|
||
package vapors.interpreter | ||
|
||
import vapors.dsl | ||
import vapors.dsl._ | ||
|
||
import org.scalacheck.{Arbitrary, Gen} | ||
import org.scalatest.freespec.AnyFreeSpec | ||
|
||
import scala.reflect.classTag | ||
|
||
class ExponentiateOutputsSpec extends AnyFreeSpec { | ||
|
||
"Expr.ExponentiateOutputs" - { | ||
|
||
"reasonable positive number raised to a reasonable positive exponent" in { | ||
VaporsEvalTestHelpers.producesTheSameResultOrException[Double, Double, Double, ArithmeticException]( | ||
Math.pow, | ||
(b, e) => dsl.pow(const(b), const(e)), | ||
)(Arbitrary(Gen.choose(0d, 100d)), Arbitrary(Gen.choose(1d, 10d)), classTag[ArithmeticException]) | ||
} | ||
|
||
"arbitrary number raised to a arbitrary exponent" in { | ||
VaporsEvalTestHelpers.producesTheSameResultOrException[Double, Double, Double, ArithmeticException]( | ||
Math.pow, | ||
(b, e) => dsl.pow(const(b), const(e)), | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters