diff --git a/options_test.go b/options_test.go new file mode 100644 index 0000000..39421c8 --- /dev/null +++ b/options_test.go @@ -0,0 +1,23 @@ +package astra + +import "testing" + +var optionSets = [][]Option{ + { + IgnoreVariables, IgnoreMethods, + }, + { + IgnoreFunctions, IgnoreInterfaces, IgnoreMethods, IgnoreConstants, + }, +} + +func TestOptions(t *testing.T) { + for _, s := range optionSets { + concated := concatOptions(s) + for i := range s { + if !concated.check(s[i]) { + t.Error(concated, s[i]) + } + } + } +} diff --git a/parser.go b/parser.go index 341804f..1b1c42f 100644 --- a/parser.go +++ b/parser.go @@ -23,8 +23,8 @@ var ( type Option uint const ( - IgnoreComments Option = 1 - IgnoreStructs Option = iota * 2 + IgnoreComments Option = 1 << iota + IgnoreStructs IgnoreInterfaces IgnoreFunctions IgnoreMethods