idk oh well

This commit is contained in:
mindfulminun committed 2023-12-12 21:21:15 -06:00
1 parent 6834c45ac1
commit 528fbc7a92
10 files changed
+263 -72

No files matched your search

+10
View File
@@ -52,6 +52,16 @@ Deno.test('GraphSolver::bidi Path', () => {
)
})
Deno.test('GraphSolver::kruskalPresorted', () => {
const G = g3()
const solver = new GraphSolver(G)
const set = solver.kruskalPresorted()
// const expected = new Set<string>(['GH', 'FG', 'CI', 'AB', 'CF', 'GI', 'CD', 'AH'])
// ;[...set].map(e => e.id).forEach(e => expected.delete(e))
// if (expected.size > 0) throw Error(`Missing edges: ${[...expected].join(', ')}`)H
throw Error(set.size + '')
})
function assertPathsEqual<vData, eData>(
path: Path<vData, eData> | null | undefined,
expectedV: string[],
+2 -6
View File
@@ -1,12 +1,8 @@
import {
choose, fill, range, limit
fill, range, limit
} from "../core/iterable.ts"
import { assertThrows, assertEquals, assert } from "https://deno.land/[email protected]/testing/asserts.ts"
Deno.test("choose: throw on empty array", () => {
assertThrows(() => choose([]))
})
import { assertEquals, assert } from "https://deno.land/[email protected]/testing/asserts.ts"
Deno.test("fill, yield the same value every time", () => {
const count = 50_000
+3 -1
View File
@@ -1,5 +1,7 @@
import { range } from "../core/iterable.ts";
import { BinaryHeap, Queue, Stack } from "../tools/structures.ts"
import { Queue } from "../tools/structures/Queue.ts"
import { Stack } from "../tools/structures/Stack.ts"
import { BinaryHeap } from "../tools/structures/Heap.ts"
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts"