test: Refine the test cases.

This commit is contained in:
Revone 2023-12-12 10:13:34 +08:00
parent 4d88405ac1
commit 61369adbdd
3 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file.
- [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
- [`auto-changelog`](https://github.com/CookPete/auto-changelog)
## [v1.49.0](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming)
## [v1.49.1](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming)
### Changes

View file

@ -689,7 +689,7 @@ describe('DirectedGraph getCycles', () => {
graph.addEdge('E', 'B');
const cycles = graph.getCycles();
expect(cycles.size).toBe(1);
expect(cycles.get(2)).toEqual( [{"key": "B", "value": undefined}, {"key": "D", "value": undefined}, {"key": "E", "value": undefined}]);
expect(cycles.get(2)).toEqual( [{ "key": "B", "value": undefined }, { "key": "D", "value": undefined }, { "key": "E", "value": undefined }]);
})
})

View file

@ -278,7 +278,7 @@ describe('UndirectedGraph getCycles', () => {
graph.addEdge('E', 'B');
const cycles = graph.getCycles();
expect(cycles.size).toBe(2);
expect(cycles.get(1)).toEqual([{"key": "A", "value": "A"}, {"key": "B", "value": "B"}, {"key": "D", "value": "D"}, {"key": "C", "value": "C"}]);
expect(cycles.get(2)).toEqual([{"key": "B", "value": "B"}, {"key": "D", "value": "D"}, {"key": "E", "value": "E"}]);
expect(cycles.get(1)).toEqual([{ "key": "A", "value": "A" }, { "key": "B", "value": "B" }, { "key": "D", "value": "D" }, { "key": "C", "value": "C" }]);
expect(cycles.get(2)).toEqual([{ "key": "B", "value": "B" }, { "key": "D", "value": "D" }, { "key": "E", "value": "E" }]);
})
})