Skip to content

Add direct unit tests for patternMatch and patternMatchAll - #476

Open
magic-peach wants to merge 1 commit into
k0sproject:mainfrom
magic-peach:test/sshconfig-patternmatch-coverage
Open

magic-peach wants to merge 1 commit into
k0sproject:mainfrom
magic-peach:test/sshconfig-patternmatch-coverage

Conversation

@magic-peach

Copy link
Copy Markdown
Contributor

sshconfig/patternmatch.go's patternMatch and patternMatchAll had no direct unit tests, only indirect coverage via TestPatternMatchingAndNegation in set_test.go. Adds TestPatternMatch (bare *, exact literal, suffix wildcard, ? single-char, dot-escaping) and TestPatternMatchAll (positive match, negation-alone-never-matches, negation excluding a positive match, comma-split/trim, blank pattern skipping, no-patterns case).

Tested with go test ./sshconfig/..., all passing including the existing test. go vet and gofmt -l clean.

This repo has no PR template, so this description is plain factual text.

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant