chore: merge blocksuite source code (#9213)

This commit is contained in:
Mirone
2024-12-20 15:38:06 +08:00
committed by GitHub
parent 2c9ef916f4
commit 30200ff86d
2031 changed files with 238888 additions and 229 deletions
@@ -0,0 +1,23 @@
import { Bound } from '@blocksuite/global/utils';
import { describe, expect, it } from 'vitest';
import { Graph } from '../utils/graph.js';
describe('graph', () => {
it('neighbors', () => {
const bound = new Bound(-5, 5, 10, 10);
const graph = new Graph(
[
[0, 0],
[100, 0],
[0, 100],
[100, 100],
],
[bound]
);
const neighbors = graph.neighbors([0, 0]);
expect(neighbors.length).toBe(1);
expect(neighbors[0][0]).toBe(100);
expect(neighbors[0][1]).toBe(0);
});
});