@@ -188,3 +188,51 @@ export const testRecursiveSameRoot = (needCheck = true) => async () => {
188188 }
189189 if ( ! errored ) throw new Error ( 'Recursion error not exists' ) ;
190190} ;
191+ export const testSeparation1 = ( needCheck = true ) => async ( ) => {
192+ debug ( 'testSeparation1' ) ;
193+ await clear ( type_id ) ;
194+ const a = await insertNode ( type_id , 'node' ) ;
195+ const b = await insertNode ( type_id , 'node' ) ;
196+ const c = await insertNode ( type_id , 'node' ) ;
197+ const d = await insertNode ( type_id , 'node' ) ;
198+ const e = await insertNode ( type_id , 'node' ) ;
199+ const x = await insertLink ( a , b , type_id , 'down' ) ;
200+ const y = await insertLink ( b , c , type_id , 'down' ) ;
201+ const z = await insertLink ( c , d , type_id , 'down' ) ;
202+ const w = await insertLink ( d , e , type_id , 'down' ) ;
203+ if ( needCheck ) await checkManual ( [
204+ [ a , 0 , 0 , type_id , [ [ a , a ] ] ] ,
205+ [ b , 0 , 0 , type_id , [ [ a , a ] , [ a , x ] , [ a , b ] ] ] ,
206+ [ c , 0 , 0 , type_id , [ [ a , a ] , [ a , x ] , [ a , b ] , [ a , y ] , [ a , c ] ] ] ,
207+ [ d , 0 , 0 , type_id , [ [ a , a ] , [ a , x ] , [ a , b ] , [ a , y ] , [ a , c ] , [ a , z ] , [ a , d ] ] ] ,
208+ [ e , 0 , 0 , type_id , [ [ a , a ] , [ a , x ] , [ a , b ] , [ a , y ] , [ a , c ] , [ a , z ] , [ a , d ] , [ a , w ] , [ a , e ] ] ] ,
209+ [ x , a , b , type_id , [ [ a , a ] , [ a , x ] ] ] ,
210+ [ y , b , c , type_id , [ [ a , a ] , [ a , x ] , [ a , b ] , [ a , y ] ] ] ,
211+ [ z , c , d , type_id , [ [ a , a ] , [ a , x ] , [ a , b ] , [ a , y ] , [ a , c ] , [ a , z ] ] ] ,
212+ [ w , d , e , type_id , [ [ a , a ] , [ a , x ] , [ a , b ] , [ a , y ] , [ a , c ] , [ a , z ] , [ a , d ] , [ a , w ] ] ] ,
213+ ] , type_id , GRAPH_TABLE , MP_TABLE ) ;
214+ } ;
215+ export const testSeparation2 = ( needCheck = true ) => async ( ) => {
216+ debug ( 'testSeparation2' ) ;
217+ await clear ( type_id ) ;
218+ const a = await insertNode ( type_id , 'node' ) ;
219+ const b = await insertNode ( type_id , 'node' ) ;
220+ const c = await insertNode ( type_id , 'node' ) ; // -
221+ const d = await insertNode ( type_id , 'node' ) ; // |
222+ const e = await insertNode ( type_id , 'node' ) ; // |
223+ const x = await insertLink ( a , b , type_id , 'down' ) ;
224+ const y = await insertLink ( b , c , type_id , 'down' ) ; // -
225+ const z = await insertLink ( c , d , type_id , 'down' ) ; // |
226+ const w = await insertLink ( d , e , type_id , 'down' ) ; // |
227+ await deleteNode ( y ) ; // -
228+ if ( needCheck ) await checkManual ( [
229+ [ a , 0 , 0 , type_id , [ [ a , a ] ] ] ,
230+ [ b , 0 , 0 , type_id , [ [ a , a ] , [ a , x ] , [ a , b ] ] ] ,
231+ [ c , 0 , 0 , type_id , [ [ c , c ] ] ] ,
232+ [ d , 0 , 0 , type_id , [ [ c , c ] , [ c , z ] , [ c , d ] ] ] ,
233+ [ e , 0 , 0 , type_id , [ [ c , c ] , [ c , z ] , [ c , d ] , [ c , w ] , [ c , e ] ] ] ,
234+ [ x , a , b , type_id , [ [ a , a ] , [ a , x ] ] ] ,
235+ [ z , c , d , type_id , [ [ c , c ] , [ c , z ] ] ] ,
236+ [ w , d , e , type_id , [ [ c , c ] , [ c , z ] , [ c , d ] , [ c , w ] ] ] ,
237+ ] , type_id , GRAPH_TABLE , MP_TABLE ) ;
238+ } ;
0 commit comments