Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError when using _update in required file #74

Open
Kikketer opened this issue Dec 17, 2020 · 0 comments
Open

AssertionError when using _update in required file #74

Kikketer opened this issue Dec 17, 2020 · 0 comments

Comments

@Kikketer
Copy link

Kikketer commented Dec 17, 2020

I'm attempting to create a little bit of a test for my external files.

I created a file something.lua and it contains the text from the docs:

local HandyPackage = {
  handyfunc = function(x, y)
    return x + y
  end,
  handynumber = 3.14,
}

function _update()
  test1 = HandyPackage.handyfunc(2, 3)
end
function _draw()
  cls()
  print('test1 = '..test1)
end

return HandyPackage

I then have a another.lua file that simply does the require:

Something = require('something')

When I attempt to run the build:

p8tool build side.p8 --lua another.lua

I get the following error:

...
  File "......./picotool/pico8/lua/lua.py", line 502, in _get_text
    assert (self._tokens[self._pos].matches(lexer.TokKeyword(keyword)) or
AssertionError

I did notice that if I include the "game_loop" option in the another.lua file, it doesn't throw this error:

Something = require('something', {use_game_loop=true})

I'd like to write these loops to possibly write some tests. Or maybe there's another way to test some of your utility files and also use them for real without having to alter the code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant