Skip to content

Commit

Permalink
Merge pull request #22 from CSBiology/hotfix-synonymOutput-#21
Browse files Browse the repository at this point in the history
Synonym function output type
  • Loading branch information
omaus authored Sep 27, 2023
2 parents d02c71e + ba1ebc0 commit 4da15d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/FsOboParser/OboOntology.fs
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ type OboOntology =
|> Seq.map (
fun s ->
s.Scope,
term,
this.Terms
|> Seq.tryFind (
fun t ->
Expand All @@ -367,7 +368,7 @@ type OboOntology =
t.Name = String.replace "\"" "" s.Text
)
match sto with
| Some st -> Some (s.Scope, st)
| Some st -> Some (s.Scope, term, st)
| None -> None
)

Expand Down
4 changes: 2 additions & 2 deletions tests/FsOboParser.Tests/OboOntology.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ module OboOntologyTests =
testList "GetSynonyms" [
testCase "returns correct synonymous terms" <| fun _ ->
let actual = testOntology.GetSynonyms testTerm5
let expected = seq {Exact, testTerm1; Broad, testTerm2}
let expected = seq {Exact, testTerm5, testTerm1; Broad, testTerm5, testTerm2}
Expect.sequenceEqual actual expected "is not equal"
]
testList "TryGetSynonyms" [
testCase "returns correct synonymous terms" <| fun _ ->
let actual = testOntology.TryGetSynonyms testTerm5
let expected = seq {Exact, Some testTerm1; Broad, Some testTerm2; Narrow, None}
let expected = seq {Exact, testTerm5, Some testTerm1; Broad, testTerm5, Some testTerm2; Narrow, testTerm5, None}
Expect.sequenceEqual actual expected "is not equal"
]
]

0 comments on commit 4da15d1

Please sign in to comment.