param can take an empty value
This commit is contained in:
parent
ab635f2594
commit
9f5882719b
@ -36,5 +36,5 @@ parseParam :: Parser (Text, Text)
|
||||
parseParam = do
|
||||
param <- many1 $ satisfy (\c -> c /= '=' && c /= ',')
|
||||
"="
|
||||
val <- many1 $ notChar ','
|
||||
pure $ (strip $ pack param, strip $ pack val)
|
||||
val <- Data.Attoparsec.Text.takeWhile (/= ',')
|
||||
pure $ (strip $ pack param, strip val)
|
||||
|
@ -333,6 +333,11 @@ main = hspec $ do
|
||||
OutputFileParsed "out" (Data.Map.Strict.fromList [("nb_epochs", "12"),
|
||||
("foo", "off"),
|
||||
("bar-baz", "10")])
|
||||
it "empty val" $ do
|
||||
parseParamsFromFilePath "out-nb_epochs=1,foo=,bar-baz=8.tsv" `shouldBe`
|
||||
OutputFileParsed "out" (Data.Map.Strict.fromList [("nb_epochs", "1"),
|
||||
("foo", ""),
|
||||
("bar-baz", "8")])
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user