Skip to content

Commit

Permalink
Assert that include_str is relative to the current file
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem committed Jan 20, 2021
1 parent c524fa4 commit ec000e6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/testsuite/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4256,6 +4256,7 @@ fn test_workspaces_cwd() {
r#"
//! ```
//! assert_eq!("{expected}", std::fs::read_to_string("file.txt").unwrap());
//! assert_eq!("{expected}", include_str!("../file.txt"));
//! assert_eq!(
//! std::path::PathBuf::from(std::env!("CARGO_MANIFEST_DIR")),
//! std::env::current_dir().unwrap(),
Expand All @@ -4265,6 +4266,7 @@ fn test_workspaces_cwd() {
#[test]
fn test_unit_{expected}_cwd() {{
assert_eq!("{expected}", std::fs::read_to_string("file.txt").unwrap());
assert_eq!("{expected}", include_str!("../file.txt"));
assert_eq!(
std::path::PathBuf::from(std::env!("CARGO_MANIFEST_DIR")),
std::env::current_dir().unwrap(),
Expand All @@ -4280,6 +4282,7 @@ fn test_workspaces_cwd() {
#[test]
fn test_integration_{expected}_cwd() {{
assert_eq!("{expected}", std::fs::read_to_string("file.txt").unwrap());
assert_eq!("{expected}", include_str!("../file.txt"));
assert_eq!(
std::path::PathBuf::from(std::env!("CARGO_MANIFEST_DIR")),
std::env::current_dir().unwrap(),
Expand Down

0 comments on commit ec000e6

Please sign in to comment.