-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backmerge: #2142 s groups that combine multiple molecules get lost wh…
…en saving as ket file (#2219) (#2225) * Revert "#2142: s groups get lost when saving as ket file (#2191)" This reverts commit 2892953. * Fix S-Groups which combines multiple molecules getting lost when saving as ket file * #2142 – updated indigo version to 1.10.0-rc.3 --------- Co-authored-by: Yulei Chen <yulei_chen@epam.com>
- Loading branch information
Showing
10 changed files
with
300 additions
and
182 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
packages/ketcher-core/__tests__/domain/entities/pile.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Pile } from 'domain/entities/pile' | ||
|
||
describe('unionIntersections', () => { | ||
it('unions multiple sets which have intersections', () => { | ||
const setA = new Pile([0, 1]) | ||
const setB = new Pile([1, 2, 3]) | ||
const setC = new Pile([2, 3]) | ||
|
||
const union = Pile.unionIntersections([setA, setB, setC]) | ||
|
||
expect(union).toHaveLength(1) | ||
expect(union[0]).toEqual(new Pile([0, 1, 2, 3])) | ||
}) | ||
|
||
it('does not union sets which have no intersections', () => { | ||
const setA = new Pile([0, 1]) | ||
const setB = new Pile([2, 3]) | ||
|
||
const union = Pile.unionIntersections([setA, setB]) | ||
|
||
expect(union).toHaveLength(2) | ||
expect(union[0]).toEqual(setA) | ||
expect(union[1]).toEqual(setB) | ||
}) | ||
|
||
// Combines above two situations | ||
it('unions multiple sets which have intersections, and skips sets without intersections', () => { | ||
const setA = new Pile([0, 1]) | ||
const setB = new Pile([1, 2, 3]) | ||
const setC = new Pile([2, 3]) | ||
const setD = new Pile([4, 5]) | ||
const setE = new Pile([6]) | ||
|
||
const union = Pile.unionIntersections([setA, setB, setC, setD, setE]) | ||
|
||
expect(union).toHaveLength(3) | ||
expect(union[0]).toEqual(new Pile([0, 1, 2, 3])) | ||
expect(union[1]).toEqual(setD) | ||
expect(union[2]).toEqual(setE) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.