Skip to content

Commit

Permalink
fix parser options
Browse files Browse the repository at this point in the history
  • Loading branch information
vetcher committed Apr 18, 2018
1 parent a08ff7e commit 38bfd14
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
23 changes: 23 additions & 0 deletions options_test.go
Original file line number Diff line number Diff line change
@@ -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])
}
}
}
}
4 changes: 2 additions & 2 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ var (
type Option uint

const (
IgnoreComments Option = 1
IgnoreStructs Option = iota * 2
IgnoreComments Option = 1 << iota
IgnoreStructs
IgnoreInterfaces
IgnoreFunctions
IgnoreMethods
Expand Down

0 comments on commit 38bfd14

Please sign in to comment.