Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests using testdata input files #310

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

atc0005
Copy link
Owner

@atc0005 atc0005 commented Apr 10, 2024

Changes

  • add collection of testdata files
    • input - encoded-all - encoded-mixed - invalid-all - invalid-mixed
    • output
      • embedded
      • standalone
  • add "exported" tests which focus strictly on exported functionality of the internal/safelinks package
  • add minor dependency on the google/go-cmp package for some tests
  • add brief README for testdata content to explain purpose, importantance of preserving the exact formatting (mostly specific EOL) within the input and output testdata files

Add new testdata URLs with a url parameter

Help ensure that recent changes to require known safelinks "base" domain to be present in Safe Links URLs continutes to function as intended.

Previously, these input URLs would have been incorrectly flagged as Safe Links URLs and "decoded" into the value of the url query parameter.

References

- add collection of testdata files
  - `input`
    - `encoded-all`
    - `encoded-mixed`
    - `invalid-all`
    - `invalid-mixed`
  - `output`
    - `embedded`
    - `standalone`
- add "exported" tests which focus strictly on exported functionality
  of the `internal/safelinks` package
- add minor dependency on the `google/go-cmp` package for some tests
- add brief README for testdata content to explain purpose,
  importantance of preserving the exact formatting (mostly specific
  EOL) within the input and output testdata files

Add new testdata URLs with a url parameter

Help ensure that recent changes to require known safelinks "base"
domain to be present in Safe Links URLs continutes to function
as intended.

Previously, these input URLs would have been incorrectly flagged
as Safe Links URLs and "decoded" into the value of the `url`
query parameter.

refs GH-251
@atc0005 atc0005 added enhancement New feature or request tests labels Apr 10, 2024
@atc0005 atc0005 added this to the v0.5.0 milestone Apr 10, 2024
@atc0005 atc0005 self-assigned this Apr 10, 2024
@atc0005 atc0005 merged commit 5bcb161 into master Apr 10, 2024
31 checks passed
@atc0005 atc0005 deleted the i251-add-tests-using-testdata-input-files branch April 10, 2024 21:45
@atc0005 atc0005 mentioned this pull request Jul 16, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tests using testdata input files
1 participant