======================================== Line Filtering Tests ========================================
(t *testing.T)
| 241 | // ======================================== |
| 242 | |
| 243 | func Test_skipLine(t *testing.T) { |
| 244 | type args struct { |
| 245 | line string |
| 246 | sy []string |
| 247 | } |
| 248 | tests := []struct { |
| 249 | name string |
| 250 | args args |
| 251 | want bool |
| 252 | }{ |
| 253 | {"Match prefix @some", args{"@some line fo filtrate", []string{"@some"}}, true}, |
| 254 | {"No match - middle", args{"@some line fo filtrate", []string{"some"}}, false}, |
| 255 | {"Multiple patterns match first", args{"@some line fo filtrate", []string{"@some", "some"}}, true}, |
| 256 | {"Multiple patterns match second", args{"some @some line fo filtrate", []string{"@some", "some"}}, true}, |
| 257 | {"No match with @some", args{"some @some line fo filtrate", []string{"@some"}}, false}, |
| 258 | {"Empty patterns", args{"some @some line fo filtrate", []string{}}, false}, |
| 259 | {"Match at start #", args{"# This is a comment", []string{"#"}}, true}, |
| 260 | {"Match in middle not prefix", args{"Some data # comment", []string{"#"}}, false}, |
| 261 | {"Multiple patterns match //", args{"// Comment line", []string{"//", "#", "--"}}, true}, |
| 262 | {"No match normal data", args{"Normal data line", []string{"#", "//"}}, false}, |
| 263 | {"Empty patterns no match", args{"Any line", []string{}}, false}, |
| 264 | {"Empty line no match", args{"", []string{"#"}}, false}, |
| 265 | } |
| 266 | for _, tt := range tests { |
| 267 | t.Run(tt.name, func(t *testing.T) { |
| 268 | if got := skipLine(tt.args.line, tt.args.sy); got != tt.want { |
| 269 | t.Errorf("skipLine() = %v, want %v", got, tt.want) |
| 270 | } |
| 271 | }) |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | // ======================================== |
| 276 | // Column Visibility Tests |
nothing calls this directly
no test coverage detected