Skip to content

Fix issue in _comp#3423

Merged
demonnic merged 5 commits intoMudlet:developmentfrom
demonnic:fix_comp
Mar 11, 2020
Merged

Fix issue in _comp#3423
demonnic merged 5 commits intoMudlet:developmentfrom
demonnic:fix_comp

Conversation

@demonnic
Copy link
Copy Markdown
Member

@demonnic demonnic commented Mar 10, 2020

Brief overview of PR changes/additions

Currently, _comp will return true if table B has items in it which table A does not, as it loops table A and checks if table B has the same value at the same key.

This checks to make sure they're the same size first, and if not returns false

Motivation for adding to Mudlet

Bug found by busted test added in #3414

Other info (issues closed, discussion etc)

image

@demonnic demonnic requested a review from a team March 10, 2020 20:13
@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Mar 10, 2020

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

@demonnic
Copy link
Copy Markdown
Member Author

I may go ahead and add tests to the functions which make use of _comp and add them in this PR

…e _comp function internally, and testing they still work increases confidence in this change
@demonnic demonnic linked an issue Mar 10, 2020 that may be closed by this pull request
Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good on visual inspection. My busted setup is busted, can't test.

Great work filling these out! :)

@demonnic demonnic merged commit 85082b4 into Mudlet:development Mar 11, 2020
@demonnic demonnic deleted the fix_comp branch March 11, 2020 15:22
@demonnic demonnic linked an issue Mar 13, 2020 that may be closed by this pull request
Chris7 pushed a commit to Chris7/Mudlet that referenced this pull request Jan 2, 2022
* Fix issue in _comp where table B containing keys table A does not have would still return true
* Move table.size test to after the existing pairs loop so it will potentially fail faster
* Further optimization to avoid relooping table A to get its size, instead track it while we're looping A anyway
* Finished all pending tests in TableUtils_spec as most of them used the _comp function internally, and testing they still work increases confidence in this change
* Removing duplicate but also strangely empty test
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

Successfully merging this pull request may close these issues.

Add busted (or luaunit) tests as part of CI

2 participants