1

I'm using the Busted framework to test my lua programs. I have newest busted version

user ~ $ busted --version 2.0.rc12-0 I ran this program (its called etl) goto statement ::statement:: error loading module 'etl' from file './etl.lua': ./etl.lua:6: '=' expected near 'statement'

edit: I'm pretty sure that busted is referencing lua 5.1 or 5.2, but I only have lua 5.3.3 on my system. So how do I get busted to recognize 5.3.3?

proof I only have lua 5.3.3 on my system

me ~ $ luaver list ==> Installed versions: ==> lua-5.3.3

Update: I had some different versions of lua hidden in another folder that luaver didn't recognize. I deleted those and then busted gave me this every time I tried to run it: /usr/local/bin/busted: 3: exec: /usr/bin/lua5.1: not found Then I went to to the busted file in /usr/local/bin/busted and it was like this

#!/bin/sh

exec '/usr/bin/lua5.1' -e 'package.path="/home/sam/.luarocks/share/lua/5.1/?.lua;/home/sam/.luarocks/share/lua/5.1/?/init.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;"..package.path; package.cpath="/home/sam/.luarocks/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/?.so;"..package.cpath' -e 'local k,l,_=pcall(require,"luarocks.loader") _=k and l.add_context("busted","2.0.rc12-1")' '/usr/local/lib/luarocks/rocks/busted/2.0.rc12-1/bin/busted' "$@"

so i need to change all that shit to lua5.3. My lua 5.3 is in /usr/local/bin. Do I just take that file and start cutting out the 5.1 stuff and replacing it with 5.3 stuff?

Sam
  • 108
  • 2
  • 9
  • 1
    It seems you're using different Lua versions as REPL or for running tests. `goto` is new since 5.2, `table.move` exists since 5.3. So whatever you used to run the program seems to be using Lua 5.1. – nobody Jan 30 '17 at 06:05
  • Not sure if you know anything about busted but is there a way to make it run 5.3? – Sam Feb 02 '17 at 04:19
  • 1
    According to the git repository, the standalone program just runs `lua`, whatever version that ends up being. So check how many different `lua`s you have and where they are and why you end up running a different one than busted. – nobody Feb 02 '17 at 04:37

0 Answers0