Skip to content

Commit

Permalink
Omit the bitop tests entirely under 5.1 and 5.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Apr 8, 2021
1 parent 0ad2691 commit afc59a5
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions test/bit.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
(local fennel (require :fennel))

(fn == [test expected]
(let [opts (if (rawget _G :jit)
{:useBitLib true}
(and (not= _VERSION "Lua 5.1") (not= _VERSION "Lua 5.2"))
{})]
;; skip the test on PUC 5.1 and 5.2
(when opts
(l.assertEquals (fennel.eval test opts) expected))))
(let [opts (if (rawget _G :jit) {:useBitLib true})]
(l.assertEquals (fennel.eval test opts) expected)))

(fn test-shifts []
(== "(lshift 33 2)" 132)
Expand All @@ -24,5 +19,8 @@
(== "(bxor 1)" 1)
(== "(band)" 0))

{: test-shifts
: test-ops}
;; skip the test on PUC 5.1 and 5.2
(if (or (rawget _G :jit) (not (_VERSION:find "5%.[12]")))
{: test-shifts
: test-ops}
{})

0 comments on commit afc59a5

Please sign in to comment.