mirror of
https://github.com/IRS-Public/direct-file.git
synced 2025-06-27 20:25:52 +00:00
add spec
This commit is contained in:
parent
4082629c93
commit
6181108075
1 changed files with 45 additions and 0 deletions
|
@ -0,0 +1,45 @@
|
||||||
|
package gov.irs.factgraph.compnodes
|
||||||
|
|
||||||
|
import gov.irs.factgraph.FactDictionary
|
||||||
|
import gov.irs.factgraph.definitions.fact.{
|
||||||
|
CommonOptionConfigTraits,
|
||||||
|
CompNodeConfigElement
|
||||||
|
}
|
||||||
|
import org.scalatest.funspec.AnyFunSpec
|
||||||
|
import gov.irs.factgraph.monads.Result
|
||||||
|
import gov.irs.factgraph.types.*
|
||||||
|
|
||||||
|
class ModuloSpec extends AnyFunSpec:
|
||||||
|
describe("Modulo") {
|
||||||
|
it("reduces Int modulo Int") {
|
||||||
|
val node = CompNode.fromDerivedConfig(
|
||||||
|
new CompNodeConfigElement(
|
||||||
|
"Modulo",
|
||||||
|
Seq(
|
||||||
|
new CompNodeConfigElement(
|
||||||
|
"Dividend",
|
||||||
|
Seq(
|
||||||
|
new CompNodeConfigElement(
|
||||||
|
"Int",
|
||||||
|
Seq.empty,
|
||||||
|
CommonOptionConfigTraits.value("5")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
new CompNodeConfigElement(
|
||||||
|
"Modulus",
|
||||||
|
Seq(
|
||||||
|
new CompNodeConfigElement(
|
||||||
|
"Int",
|
||||||
|
Seq.empty,
|
||||||
|
CommonOptionConfigTraits.value("3")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
assert(node.get(0) == Result.Complete(Int("2")))
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue