Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
Fix issue with new implementations ✔️
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Jul 15, 2022
1 parent 3e3586a commit 61e662d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Nfdi4Plants.Fornax/Loaders.fs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module Aux =
Fornax.Nfdi4Plants.MarkdigExtensions.Aux.splitKey line
|> fun (key, v) ->
v
|> Option.map(fun v -> (key, v))
|> Option.map(fun v -> (key.ToLower(), v))

let internal trimString (str : string) =
str.Trim().TrimEnd('"').TrimStart('"')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module internal Aux =
let splitKey (line: string) =
let seperatorIndex = line.IndexOf(':')
if seperatorIndex > 0 then
let key = line.[.. seperatorIndex - 1].Trim().ToLower()
let key = line.[.. seperatorIndex - 1].Trim()
let value = line.[seperatorIndex + 1 ..].Trim()
key, Some value
else
Expand Down
13 changes: 2 additions & 11 deletions tests/Nfdi4Plants.Fornax.Tests/Loaders.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,7 @@ author: {name: Kevin Frey, github: https://github.com/Freymaurer, orcid: 0000-00
let docs = Docs.createFromConfig config
Expect.equal docs.authors [|Author.create "Kevin Frey" (Some "https://github.com/Freymaurer") (Some "0000-0002-8510-6810")|] ""
}
test "config_author_jsonObj" {
let test_case = """---
title: My awesome title
author: {name: Kevin Frey, github: https://github.com/Freymaurer, orcid: 0000-0002-8510-6810 }
---"""
let config = getConfig test_case
let docs = Docs.createFromConfig config
Expect.equal docs.authors [|Author.create "Kevin Frey" (Some "https://github.com/Freymaurer") (Some "0000-0002-8510-6810")|] ""
}
test "config_authors" {
test "config_authors_mixed" {
let test_case = """---
title: My awesome title
author: John Doe
Expand All @@ -161,7 +152,7 @@ author: {name: Kevin Frey, github: https://github.com/Freymaurer, orcid: 0000-00
|]
Expect.equal docs.authors expected ""
}
test "config_authors_multiple_JSON" {
test "config_authors_multipleMixed" {
let test_case = """---
title: My awesome title
author: {name: John Doe, github: https://github.com/JohnDoe, orcid: 0000-0000-0000-0000}
Expand Down

0 comments on commit 61e662d

Please sign in to comment.