(t *testing.T)
| 101 | } |
| 102 | |
| 103 | func TestParseQueryFlags(t *testing.T) { |
| 104 | for _, comments := range [][]string{ |
| 105 | { |
| 106 | " name: CreateFoo :one", |
| 107 | " @flag-foo", |
| 108 | }, |
| 109 | { |
| 110 | " name: CreateFoo :one ", |
| 111 | "@flag-foo ", |
| 112 | }, |
| 113 | { |
| 114 | " name: CreateFoo :one", |
| 115 | " @flag-foo @flag-bar", |
| 116 | }, |
| 117 | { |
| 118 | " name: GetFoos :many", |
| 119 | " @param @flag-bar UUID", |
| 120 | " @flag-foo", |
| 121 | }, |
| 122 | { |
| 123 | " name: GetFoos :many", |
| 124 | " @flag-foo", |
| 125 | " @param @flag-bar UUID", |
| 126 | }, |
| 127 | } { |
| 128 | _, flags, _, err := ParseCommentFlags(comments) |
| 129 | if err != nil { |
| 130 | t.Errorf("expected comments to parse, got err: %s", err) |
| 131 | } |
| 132 | |
| 133 | if !flags["@flag-foo"] { |
| 134 | t.Errorf("expected flag not found") |
| 135 | } |
| 136 | |
| 137 | if flags["@flag-bar"] { |
| 138 | t.Errorf("unexpected flag found") |
| 139 | } |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | func TestParseQueryRuleSkiplist(t *testing.T) { |
| 144 | for _, comments := range [][]string{ |
nothing calls this directly
no test coverage detected