mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 01:49:51 +08:00
chore: merge blocksuite source code (#9213)
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user