idk oh well
This commit is contained in:
10 files changed
+263
-72
No files matched your search
@@ -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[],
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
Reference in new issue
Block a user