From 57a7f96ed0b04c634a77ed7453d4cc45f24102db Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 24 Nov 2020 14:39:59 +1000 Subject: [PATCH] update test to demonstrate include_str!() is failing for generated data --- examples/env_locations/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/env_locations/main.rs b/examples/env_locations/main.rs index 4905472f7e..49c1e29faa 100644 --- a/examples/env_locations/main.rs +++ b/examples/env_locations/main.rs @@ -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); }