-
Notifications
You must be signed in to change notification settings - Fork 48
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
Feat: Add testing for utils & delete extraneous code; #145
Conversation
I am going to make tests echo the output. I don't think it will break anything, and I want to see my new error messages... |
2b36c3f
to
81051d9
Compare
They aren't used anywhere...
Alright, that's all of the utils tested or deleted. |
lua/nordic/groups/init.lua
Outdated
|
||
local M = {} | ||
|
||
function M.get_groups() | ||
local native = require('nordic.groups.native').get_groups() | ||
local integrations = require('nordic.groups.integrations').get_groups() | ||
local groups = merge(native, integrations) | ||
local groups = merge_inplace(native, integrations) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure this should not be a merge inplace? We do not want to modify native
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works because get_groups
creates a new table each time; however, I agree it's not very clear. merge
and merge_inplace
do almost the same thing, so it feels weird to have both.
I could revert that commit or I could make it more clear with something like this:
local native = require('nordic.groups.native').get_groups()
local integrations = require('nordic.groups.integrations').get_groups()
local groups = {}
merge_inplace(groups, integrations)
merge_inplace(groups, integrations)
Which ever you think is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge and merge inplace are different enough that we would want both, it is very common to have both.
So I think we should:
- Keep both.
- If you want to keep using
merge_inplace
in this scenario, please change it the way you suggested. Just a bit more clear what is going on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in: 8c8fff4
Nice work on this PR, you really went all out :) |
Closes #140. |
I think it's good to go! |
The one issue I still have with It's no longer being used anywhere, so it won't break anything in the meantime. |
This should be good to merge into |
@5-pebbles Neovim has some nice builtin lua utils, don't forget to check them out :) |
I usually forget those exist... I will try to use them more in the future! |
Lol accidentally pushed a failing test. At least we can see it working now :) |
I deleted a substantial portion of utils:
rgb_to_hsv
,hsv_to_rbg
,darken
, andlighten
.And the utils that did survive now have some tests.