mirror of
				https://github.com/laosb/ReadabilityFramework.git
				synced 2025-10-31 07:51:37 +00:00 
			
		
		
		
	test: Long text character counting.
This commit is contained in:
		
							parent
							
								
									532dc89868
								
							
						
					
					
						commit
						5f0d996c91
					
				
					 1 changed files with 17 additions and 0 deletions
				
			
		|  | @ -31,4 +31,21 @@ final class CommonMetrics: XCTestCase { | ||||||
|       .avgWordsPerSentence: 2.0 |       .avgWordsPerSentence: 2.0 | ||||||
|     ]) |     ]) | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|  |   func testLongTextCharCount() throws { | ||||||
|  |     let calc = RACommonMetricsCalculator(metrics: [ | ||||||
|  |       .characterCount, | ||||||
|  |     ]) | ||||||
|  | 
 | ||||||
|  |     let text = | ||||||
|  |       """ | ||||||
|  |       The best things in an artist’s work are so much a matter of intuition, that there is much to be said for the point of view that would altogether discourage intellectual inquiry into artistic phenomena on the part of the artist. Intuitions are shy things and apt to disappear if looked into too closely. And there is undoubtedly a danger that too much knowledge and training may supplant the natural intuitive feeling of a student, leaving only a cold knowledge of the means of expression in its place. For the artist, if he has the right stuff in him | ||||||
|  |       """ | ||||||
|  | 
 | ||||||
|  |     let results = calc.calculate(on: text) | ||||||
|  | 
 | ||||||
|  |     XCTAssertEqual(results, [ | ||||||
|  |       .characterCount: 446.0, | ||||||
|  |     ]) | ||||||
|  |   } | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Shibo Lyu
						Shibo Lyu