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

enrich testing for cidr helpers #179

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Issacwww
Copy link
Contributor

@Issacwww Issacwww commented Oct 4, 2024

Issue number:

Closes #

Description of changes:
Running into issues when using is_ipv4 helper, try to add test and get it fixed

Testing done:

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@@ -2429,18 +2429,22 @@ mod test_cidr_to_ipaddr {
}

#[cfg(test)]
mod test_combined_template_for_ip_cidr {
use crate::helpers::{cidr_to_ipaddr, is_ipv4, replace_ipv4_octet};
mod test_full_template_for_ip_cidrs {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tests looks good

Comment on lines +200 to +201
("if_not_null", schnauzer::helpers::IfNotNullHelper),
("is_ipv4", schnauzer::helpers::is_ipv4),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting below error, need advise for correct way to import them

error[E0308]: mismatched types
   --> api/schnauzer/tests/v2_render_templates.rs:200:29
    |
200 |             ("if_not_null", schnauzer::helpers::IfNotNullHelper),
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found `IfNotNullHelper`
    |
    = note: expected fn pointer `for<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j> fn(&'a Helper<'b, 'c>, &'d Handlebars<'e>, &'f handlebars::Context, &'g mut RenderContext<'h, 'i>, &'j mut (dyn handlebars::Output + 'j)) -> Result<(), handlebars::RenderError>`
                   found struct `IfNotNullHelper`

error[E0308]: mismatched types
   --> api/schnauzer/tests/v2_render_templates.rs:201:25
    |
201 |             ("is_ipv4", schnauzer::helpers::is_ipv4),
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found `is_ipv4`
    |
    = note: expected fn pointer `for<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j> fn(&'a Helper<'b, 'c>, &'d Handlebars<'e>, &'f handlebars::Context, &'g mut RenderContext<'h, 'i>, &'j mut (dyn handlebars::Output + 'j)) -> Result<(), handlebars::RenderError>`
                   found struct `is_ipv4`

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