Skip to content

Commit

Permalink
Fixed #611: Period does not throw num exception
Browse files Browse the repository at this point in the history
  • Loading branch information
davesmith00000 committed Nov 18, 2023
1 parent 64481fe commit ea36afc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ object DataType {
final case class StringData(value: String) extends DataType

private val isBoolean: Regex = """^(true|false)$""".r
private val isDouble: Regex = """^([0-9]*?)\.([0-9]*)$""".r
private val isDouble: Regex = """^([0-9]+?)\.([0-9]+)$""".r
private val isInt: Regex = """^([0-9]+)$""".r

def decideType: String => DataType = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class EmbedDataTests extends munit.FunSuite {
}

test("Extract row data - csv - simple") {
val row = " abc,123, def,456.5 ,ghi789,true "
val row = " abc,123, def,456.5 ,ghi789,true ,."

val actual =
EmbedData.extractRowData(row, ",")
Expand All @@ -99,7 +99,8 @@ class EmbedDataTests extends munit.FunSuite {
DataType.StringData("def"),
DataType.DoubleData(456.5),
DataType.StringData("ghi789"),
DataType.BooleanData(true)
DataType.BooleanData(true),
DataType.StringData(".")
)

assertEquals(actual, expected)
Expand Down

0 comments on commit ea36afc

Please sign in to comment.