Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/DependencyGraph/Graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,16 @@ export class Graph<T> {
while ( DFSstack.length > 0 ) {
const u = DFSstack[ DFSstack.length - 1 ]
if ( processed.has(u) ) { // leaving this DFS subtree
const pu = parent.get(u)
if ( pu !== null ) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
low.set(pu!, Math.min(low.get(pu!)!, low.get(u)!))
}
DFSstack.pop()
onStack.delete(u)
order.push(u)
if(onStack.has(u)) { //otherwise its a 'shadow' copy, we already processed this vertex and can ignore
Comment thread
izulin marked this conversation as resolved.
Resolved
const pu = parent.get(u)
if ( pu !== null ) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
low.set(pu!, Math.min(low.get(pu!)!, low.get(u)!))
}
onStack.delete(u)
order.push(u)
}
} else {
processed.add(u)
entranceTime.set(u, time)
Expand Down
26 changes: 26 additions & 0 deletions test/engine.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -714,3 +714,29 @@ describe('dateTime', () => {
expect(engine.numberToTime(1.1)).toEqual({'hours': 26, 'minutes': 24, 'seconds': 0})
})
})

describe('engine should build correctly', () => {
it('should build correctly #1', () => {
Comment thread
izulin marked this conversation as resolved.
Resolved
expect(() => HyperFormula.buildFromArray([
['=A3+A2'],
['=A3'],
])).not.toThrowError()
})

it('should build correctly #2', () => {
expect(() => HyperFormula.buildFromArray([
['=A4+A3+A2'],
['=A4+A3'],
['=A4'],
])).not.toThrowError()
})

it('should build correctly #3', () => {
expect(() => HyperFormula.buildFromArray([
['=A5+A4+A3+A2'],
['=A5+A4+A3'],
['=A5+A4'],
['=A5'],
])).not.toThrowError()
})
})