dmarkham / enumer

A Go tool to auto generate methods for your enums
Other
411 stars 63 forks source link

Allow multiple trim prefixes #26

Closed sgtsquiggs closed 4 years ago

sgtsquiggs commented 4 years ago

Allows multiple trim prefixes, separated by commas

codecov-io commented 4 years ago

Codecov Report

Merging #26 into master will increase coverage by 0.53%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #26      +/-   ##
==========================================
+ Coverage   65.13%   65.67%   +0.53%     
==========================================
  Files           3        3              
  Lines         436      437       +1     
==========================================
+ Hits          284      287       +3     
+ Misses        140      139       -1     
+ Partials       12       11       -1
Impacted Files Coverage Δ
stringer.go 60.52% <100%> (+0.63%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f93c6b0...0e5dcec. Read the comment docs.

dmarkham commented 4 years ago

this looks good... I'll review it more closely asap

dmarkham commented 4 years ago

@sgtsquiggs So the more I look at this the more I think the testing of this feature is wrong. Or I do not understand something :)

It seems to be the code change wants to be able to trim more than one Prefix within a single type.. but the testing seems to be testing 2 different types with 2 different prefixes.

dmarkham commented 4 years ago

What i was thinking is the test to input would look more like this.

const trimPrefixMultipleIn = `type Day int
const (
    DayMonday Day = iota
    NightTuesday
    DayWednesday
    NightThursday
    DayFriday
    NightSaturday
    DaySunday
)
dmarkham commented 4 years ago

Going to be merged in #29 thank you @sgtsquiggs for the code.... I just reworked the test cases.