Skip to content

Conversation

andrewmwells-amazon
Copy link
Contributor

@andrewmwells-amazon andrewmwells-amazon commented Nov 16, 2023

Description of changes

Move tests out of api.rs. IMO this is cleaner than having almost 3k lines of tests in the public API.

Issue #, if available

Checklist for requesting a review

The change in this PR is (choose one, and delete the other options):

  • A change "invisible" to users (e.g., documentation, changes to "internal" crates like cedar-policy-core, cedar-validator, etc.)

I confirm that this PR (choose one, and delete the other options):

  • Does not update the CHANGELOG because my change does not significantly impact released code.

I confirm that cedar-spec (choose one, and delete the other options):

  • Does not require updates because my change does not impact the Cedar Dafny model or DRT infrastructure.

Disclaimer

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@shaobo-he-aws
Copy link
Contributor

LGTM. That being said, is there a convention where we want to put unit tests (e.g., a dedicated folder)?

@cdisselkoen
Copy link
Contributor

stupid question, did you do the simple check that the tests are still running? (like, just break one and check.) I'm a little surprised we didn't need mod tests; anywhere

@andrewmwells-amazon
Copy link
Contributor Author

LGTM. That being said, is there a convention where we want to put unit tests (e.g., a dedicated folder)?

I just followed e.g., https://github.com/rust-lang/rust/blob/master/compiler/rustc_graphviz/src/tests.rs here. I don't know if a one-size-fits-all strategy makes the most sense.

@andrewmwells-amazon
Copy link
Contributor Author

stupid question, did you do the simple check that the tests are still running? (like, just break one and check.) I'm a little surprised we didn't need mod tests; anywhere

We did in fact need a mod tests;

@andrewmwells-amazon
Copy link
Contributor Author

This reverts commit 933a4ad.
Copy link
Contributor

@john-h-kastner-aws john-h-kastner-aws left a comment

Choose a reason for hiding this comment

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

I like it.

@andrewmwells-amazon andrewmwells-amazon merged commit 3c6711d into main Nov 17, 2023
@andrewmwells-amazon andrewmwells-amazon deleted the andrewmwells/test-cleanup branch November 17, 2023 17:39
shaobo-he-aws pushed a commit that referenced this pull request May 20, 2025
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.

5 participants