~technomancy/fennel

ref: 83ccb3c3345e84c59303fcd97db257d533905399 fennel/test/linter.fnl -rw-r--r-- 408 bytes
83ccb3c3Phil Hagelberg Fix apropos tests for other Lua versions. 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
(local l (require :test.luaunit))
(local fennel (require :fennel))
(local linter (fennel.dofile "src/linter.fnl" {:env :_COMPILER}))

(fn test-used []
  "A test for the locals shadowing bug described in
https://todo.sr.ht/~technomancy/fennel/12"
  (let [src "(fn [abc] (let [abc abc] abc))"
        (ok? msg) (pcall fennel.compile-string src {:plugins [linter]})]
    (l.assertTrue ok? msg)))

{: test-used}