Skip to content

Commit

Permalink
Lua, Python: use special translation method for expected value of flo…
Browse files Browse the repository at this point in the history
…at checks as well

If it is used in `simpleEquality`, then it should be used in `floatEquality` as well
  • Loading branch information
Mingun authored and GreyCat committed Apr 13, 2024
1 parent faf7ccc commit fdd71ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class LuaSG(spec: TestSpec, provider: ClassTypeProvider) extends BaseGenerator(s

override def floatEquality(check: TestEquals): Unit = {
val actStr = translateAct(check.actual)
val expStr = translator.translate(check.expected)
val expStr = translateExp(check.expected)
out.puts(s"luaunit.assertAlmostEquals($actStr, $expStr, 0.000001)")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class PythonSG(spec: TestSpec, provider: ClassTypeProvider) extends BaseGenerato

override def floatEquality(check: TestEquals): Unit = {
val actStr = translateAct(check.actual)
val expStr = translator.translate(check.expected)
val expStr = translateExp(check.expected)
out.puts(s"self.assertAlmostEqual($actStr, $expStr, 6)")
}

Expand Down

0 comments on commit fdd71ae

Please sign in to comment.