Commit 4158995a authored by Hans-Peter Deifel's avatar Hans-Peter Deifel 🐢
Browse files

Add test for approximate double comparison

parent 6f021e05
...@@ -51,6 +51,19 @@ parseMorphismPointSpec = describe "parseMorphismPoint" $ do ...@@ -51,6 +51,19 @@ parseMorphismPointSpec = describe "parseMorphismPoint" $ do
parseMorphisms (Functor 1 (Distribution Variable)) "" `shouldFailOn` parseMorphisms (Functor 1 (Distribution Variable)) "" `shouldFailOn`
"x: {x: 0.5}" "x: {x: 0.5}"
it "uses approximate comparison for doubles" $
parseMorphisms (Functor 1 (Distribution Variable)) "" `shouldSucceedOn`
"s0: {s0: 0.1, s1: 0.1, s2: 0.1, s3: 0.1, s4: 0.1, s5: 0.1, s6: 0.1, s7: 0.1, s8: 0.1, s9: 0.1}\n\
\s1: {s1: 1.0}\n\
\s2: {s2: 1.0}\n\
\s3: {s3: 1.0}\n\
\s4: {s4: 1.0}\n\
\s5: {s5: 1.0}\n\
\s6: {s6: 1.0}\n\
\s7: {s7: 1.0}\n\
\s8: {s8: 1.0}\n\
\s9: {s9: 1.0}"
refineSpec :: Spec refineSpec :: Spec
refineSpec = describe "refining" $ do refineSpec = describe "refining" $ do
let f = Functor 1 (Distribution Variable) let f = Functor 1 (Distribution Variable)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment