Fix ReadabilityTest

This commit is contained in:
Billy Brawner 2019-08-17 14:37:34 -05:00 committed by William Brawner
parent 278d78532b
commit f03a91c1d3
2 changed files with 1 additions and 4 deletions

View file

@ -2,7 +2,7 @@ package com.wbrawner.simplemarkdown.model
import eu.crydee.syllablecounter.SyllableCounter import eu.crydee.syllablecounter.SyllableCounter
class Sentence(content: String, private var start: Int = 0, private val end: Int = 0) { class Sentence(content: String, private var start: Int = 0, private val end: Int = content.length) {
private var sentence = content.substring(start, end) private var sentence = content.substring(start, end)
private val sc = SyllableCounter() private val sc = SyllableCounter()

View file

@ -38,12 +38,9 @@ class ReadabilityTest {
assertEquals(39, thisIsATest.end().toLong()) assertEquals(39, thisIsATest.end().toLong())
} }
@Test @Test
fun get_syllable_count_for_sentence() { fun get_syllable_count_for_sentence() {
assertEquals(8, Sentence("This is the song that never ends").syllableCount().toLong()) assertEquals(8, Sentence("This is the song that never ends").syllableCount().toLong())
assertEquals(10, Sentence("facility facility downing").syllableCount().toLong()) assertEquals(10, Sentence("facility facility downing").syllableCount().toLong())
} }
} }