From f03a91c1d350d2c0ed2dd5cdc9255b62f4da592c Mon Sep 17 00:00:00 2001 From: Billy Brawner Date: Sat, 17 Aug 2019 14:37:34 -0500 Subject: [PATCH] Fix ReadabilityTest --- .../main/java/com/wbrawner/simplemarkdown/model/Sentence.kt | 2 +- .../test/java/com/wbrawner/simplemarkdown/ReadabilityTest.kt | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/model/Sentence.kt b/app/src/main/java/com/wbrawner/simplemarkdown/model/Sentence.kt index 8cce10d..7d64ae7 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/model/Sentence.kt +++ b/app/src/main/java/com/wbrawner/simplemarkdown/model/Sentence.kt @@ -2,7 +2,7 @@ package com.wbrawner.simplemarkdown.model 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 val sc = SyllableCounter() diff --git a/app/src/test/java/com/wbrawner/simplemarkdown/ReadabilityTest.kt b/app/src/test/java/com/wbrawner/simplemarkdown/ReadabilityTest.kt index 9602ddb..f81f570 100644 --- a/app/src/test/java/com/wbrawner/simplemarkdown/ReadabilityTest.kt +++ b/app/src/test/java/com/wbrawner/simplemarkdown/ReadabilityTest.kt @@ -38,12 +38,9 @@ class ReadabilityTest { assertEquals(39, thisIsATest.end().toLong()) } - @Test fun get_syllable_count_for_sentence() { assertEquals(8, Sentence("This is the song that never ends").syllableCount().toLong()) assertEquals(10, Sentence("facility facility downing").syllableCount().toLong()) } - - }