squiggle/packages/squiggle-lang/__tests__/ReducerProject/ReducerProject_Topology_test.res
2022-08-26 01:32:38 +02:00

37 lines
882 B
Plaintext

@@warning("-44")
module Topology = ReducerProject_Topology
open Jest
open Expect
open Expect.Operators
describe("Topology Diff", () => {
test("when equal 1x", () => {
Topology.runOrderDiff(["a"], ["a"])->expect == []
})
test("when equal 3x", () => {
Topology.runOrderDiff(["a", "b", "c"], ["a", "b", "c"])->expect == []
})
test("less dependents", () => {
Topology.runOrderDiff(["a", "b"], ["a", "b", "c", "d"])->expect == []
})
test("more dependents", () => {
Topology.runOrderDiff(["a", "b", "c", "d"], ["a", "b"])->expect == ["c", "d"]
})
test("change midway", () => {
Topology.runOrderDiff(["a", "b", "bb", "c", "d"], ["a", "b", "c", "d"])->expect == [
"bb",
"c",
"d",
]
})
test("swap", () => {
Topology.runOrderDiff(["a", "b", "c", "d"], ["a", "c", "b", "d"])->expect == ["b", "c", "d"]
})
})