Closed seahorse47 closed 5 years ago
Thanks for the report and the Pull Request. I am quite slow those days to react, sorry for that. I need more time to understand the proposal because it touches parts of the code which I have not written myself.
I'll let you know of the progress.
Ok, I get it. The misbehaving code was trying to get the reference value of the table, when the metatable has a tostring(). Now the question is: how do I obtain the reference of a table, whose metatable is both protected and contains a tostring() converter ?
I don't see how to do that right now, but in the meantime, I can still fix your reported bug.
Thanks a lot.
fixed in 2d85352c92303a4032ff5fbde782cb9e765c3f9d
I use
assertIs()
/assertNotIs()
to verify if two object references (actually two tables with protected metatables) are the same / different. When it fails, I get errorcannot change a protected metatable
in_table_raw_tostring()
function. This is caused byprettystrPairs()
function calls whenassertIs()
/assertNotIs()
fails. Here is the example code:P.S. When I use
assertIs()
on tables, I don't really care about the contents in the tables. I do only care whether they are the same.assertEquals()
may be a better choice when I care about the contents.Is it possible to show only table references in fail messages ofassertIs()
/assertNotIs()
?