Skip to content

Commit

Permalink
update test to demonstrate include_str!() is failing for generated data
Browse files Browse the repository at this point in the history
  • Loading branch information
dae committed Dec 7, 2020
1 parent bc05787 commit 57a7f96
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/env_locations/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ fn test() {
// our source file should be readable
let source_file = std::fs::read_to_string(env!("SOURCE_FILE")).unwrap();
assert_eq!(source_file, "source\n");
// our generated data file should be readable
// our generated data file should be readable at run time and build time
let generated_data = std::fs::read_to_string(env!("GENERATED_DATA")).unwrap();
assert_eq!(generated_data, "hello\n");
let generated_data2 = include_str!(env!("GENERATED_DATA"));
assert_eq!(generated_data, generated_data2);
// and we should be able to read (and thus execute) our tool
assert_eq!(std::fs::read(env!("SOME_TOOL")).unwrap().is_empty(), false);
}

0 comments on commit 57a7f96

Please sign in to comment.