1
0
Fork 0
mirror of https://github.com/IRS-Public/direct-file.git synced 2025-06-27 20:25:52 +00:00
This commit is contained in:
Elijah Wright 2025-06-04 07:54:03 -07:00
parent 4082629c93
commit 6181108075

View file

@ -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")))
}
}