reproduce #271
This commit is contained in:
		
							parent
							
								
									728bb6f1b2
								
							
						
					
					
						commit
						edc1f9418f
					
				@ -78,6 +78,29 @@ export const testBasicFormat = tc => {
 | 
				
			|||||||
  compare(users)
 | 
					  compare(users)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * @param {t.TestCase} tc
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const testMultilineFormat = tc => {
 | 
				
			||||||
 | 
					  const ydoc = new Y.Doc()
 | 
				
			||||||
 | 
					  const testText = ydoc.getText('test')
 | 
				
			||||||
 | 
					  testText.insert(0, 'Test\nMulti-line\nFormatting')
 | 
				
			||||||
 | 
					  testText.applyDelta([
 | 
				
			||||||
 | 
					    { retain: 4, attributes: { bold: true } },
 | 
				
			||||||
 | 
					    { retain: 1 }, // newline character
 | 
				
			||||||
 | 
					    { retain: 10, attributes: { bold: true } },
 | 
				
			||||||
 | 
					    { retain: 1 }, // newline character
 | 
				
			||||||
 | 
					    { retain: 10, attributes: { bold: true } }
 | 
				
			||||||
 | 
					  ])
 | 
				
			||||||
 | 
					  t.compare(testText.toDelta(), [
 | 
				
			||||||
 | 
					    { insert: 'Test', attributes: { bold: true } },
 | 
				
			||||||
 | 
					    { insert: '\n' },
 | 
				
			||||||
 | 
					    { insert: 'Multi-line', attributes: { bold: true } },
 | 
				
			||||||
 | 
					    { insert: '\n' },
 | 
				
			||||||
 | 
					    { insert: 'Formatting', attributes: { bold: true } }
 | 
				
			||||||
 | 
					  ])
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @param {t.TestCase} tc
 | 
					 * @param {t.TestCase} tc
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
@ -286,7 +309,9 @@ export const testBestCase = tc => {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const tryGc = () => {
 | 
					const tryGc = () => {
 | 
				
			||||||
 | 
					  // @ts-ignore
 | 
				
			||||||
  if (typeof global !== 'undefined' && global.gc) {
 | 
					  if (typeof global !== 'undefined' && global.gc) {
 | 
				
			||||||
 | 
					    // @ts-ignore
 | 
				
			||||||
    global.gc()
 | 
					    global.gc()
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user