-
Notifications
You must be signed in to change notification settings - Fork 25
Adds GetEnumItems #119
base: master
Are you sure you want to change the base?
Adds GetEnumItems #119
Conversation
Didn't notice this failed. Fixing. |
lib/createEnumGroup_spec.lua
Outdated
|
||
local enumItemFunny = enumItems[2] | ||
assert.equal(enumItemFunny.Name, "Funny") | ||
assert.equal(enumItemFunny.Value, 2) |
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.
This test is flaky and depends on iteration order. If we're going to keep the current implementation, the order needs to either be unimportant or deterministic.
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.
I'll fix it.
return function() | ||
return enumItems | ||
end | ||
end |
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.
This is kind of a bolt-on solution, we should probably make a table containing the enum variant's methods and explicitly index into it instead of comparing the key with a constant.
Additionally, we should return the same function every time, otherwise Foo.GetEnumItems ~= Foo.GetEnumItems
!
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.
I'll fix it. [2]
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.
I'm not sure where I'd add this to FEATURES.md.