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

dev branch: date overflow in test-date #333

Open
Bilal2453 opened this issue Jan 17, 2022 · 0 comments
Open

dev branch: date overflow in test-date #333

Bilal2453 opened this issue Jan 17, 2022 · 0 comments

Comments

@Bilal2453
Copy link
Contributor

Bilal2453 commented Jan 17, 2022

Running the tests yields the following error:

Uncaught exception:
...e/Dev/Luvit/discordia/discordia-fork/tests/test-date.lua:179: expected: "date could not be converted to time", received: "...l/home/Dev/Luvit/discordia/discordia-fork/libs/class.lua:16: expected minimum 0, received -31536000"
stack traceback:
	[C]: in function 'assertError'
	...e/Dev/Luvit/discordia/discordia-fork/tests/test-date.lua:179: in function 'fn'
	[string "bundle:deps/require.lua"]:310: in function 'require'
	...al/home/Dev/Luvit/discordia/discordia-fork/tests/run.lua:11: in function 'fn'
	[string "bundle:deps/require.lua"]:310: in function 'require'
	[string "bundle:/main.lua"]:128: in function <[string "bundle:/main.lua"]:20>
stack traceback:
	[C]: in function 'error'
	[string "bundle:/deps/utils.lua"]:41: in function 'assertResume'
	[string "bundle:/init.lua"]:52: in function <[string "bundle:/init.lua"]:47>
	[C]: in function 'xpcall'
	[string "bundle:/init.lua"]:47: in function 'fn'
	[string "bundle:deps/require.lua"]:310: in function <[string "bundle:deps/require.lua"]:266>

The system's clock is GMT+3.

Traced the error a bit, here os.time overflows returning a value of -31546800, here it seems like it fails to normalize it to 0 (if that was suppose to happen, don't seem it is) and here the error is raised.

Now the value passed in the test is 1969, so I suppose it is meant to raise this error? It is really expected to overflow in this case, so I guess the bug here is just the assertError call used.
Edit: At least what I assume, all of this is based on assumptions since I am not entirely sure what is the supposed behavior.

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