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

Use include_str! in test #136

Open
rootkc opened this issue Dec 26, 2022 · 1 comment
Open

Use include_str! in test #136

rootkc opened this issue Dec 26, 2022 · 1 comment

Comments

@rootkc
Copy link

rootkc commented Dec 26, 2022

I use Rust skeptic for managing my snippets for SOME. I was creating a snippet like this:

fn main() {
    // The contents of file.txt is "Hello world!"
    let str_from_file = include_str!("file.txt");
    assert_eq!(str_from_file, "Hello world!");
}

And I Couldn't get it to work because file.txt wasn't available at compile time.

How would I add external files that are supposed to be compiled into the tests? This is super useful for Internationalization like Fluent and Template libraries like Tera.

@djc
Copy link
Collaborator

djc commented Mar 3, 2023

See #140.

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

No branches or pull requests

2 participants