From 0a8afc66a4d0f24e9cc4fdf384edeced0e6c9a62 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Fri, 26 Aug 2022 01:32:38 +0200 Subject: [PATCH] fix Topology test --- .../ReducerProject_Topology_test.res | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/squiggle-lang/__tests__/ReducerProject/ReducerProject_Topology_test.res b/packages/squiggle-lang/__tests__/ReducerProject/ReducerProject_Topology_test.res index 2399c808..da5ab5af 100644 --- a/packages/squiggle-lang/__tests__/ReducerProject/ReducerProject_Topology_test.res +++ b/packages/squiggle-lang/__tests__/ReducerProject/ReducerProject_Topology_test.res @@ -5,7 +5,7 @@ open Jest open Expect open Expect.Operators -describe("Topology", () => { +describe("Topology Diff", () => { test("when equal 1x", () => { Topology.runOrderDiff(["a"], ["a"])->expect == [] }) @@ -21,4 +21,16 @@ describe("Topology", () => { 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"] + }) })