diff --git a/rinja_derive/src/config.rs b/rinja_derive/src/config.rs index 54476d94..6bfa17bc 100644 --- a/rinja_derive/src/config.rs +++ b/rinja_derive/src/config.rs @@ -407,7 +407,14 @@ mod tests { } fn assert_eq_rooted(actual: &Path, expected: &str) { - let mut root = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); + let mut root = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()) + .canonicalize() + .unwrap(); + if root.ends_with("rinja_derive_standalone") { + root.pop(); + root.push("rinja_derive"); + } + root.push("templates"); let mut inner = PathBuf::new(); inner.push(expected); diff --git a/testing/Cargo.toml b/testing/Cargo.toml index 650ebdbb..3b03019c 100644 --- a/testing/Cargo.toml +++ b/testing/Cargo.toml @@ -25,7 +25,7 @@ rinja = { path = "../rinja", version = "0.3.5", features = ["code-in-doc", "serd criterion = "0.5" phf = { version = "0.11", features = ["macros" ] } -trybuild = "1.0.76" +trybuild = "1.0.100" [[bench]] name = "all" diff --git a/testing/tests/ui/cycle.stderr b/testing/tests/ui/cycle.stderr index 90f26b53..bebec761 100644 --- a/testing/tests/ui/cycle.stderr +++ b/testing/tests/ui/cycle.stderr @@ -1,6 +1,6 @@ error: cyclic dependency in graph [ - "\"$WORKSPACE/target/tests/trybuild/rinja_testing/templates/cycle2.html/" --> \"$WORKSPACE/target/tests/trybuild/rinja_testing/templates/cycle1.html/"", - "\"$WORKSPACE/target/tests/trybuild/rinja_testing/templates/cycle1.html/" --> \"$WORKSPACE/target/tests/trybuild/rinja_testing/templates/cycle1.html/"", + "\"$DIR/templates/cycle2.html/" --> \"$DIR/templates/cycle1.html/"", + "\"$DIR/templates/cycle1.html/" --> \"$DIR/templates/cycle1.html/"", ] --> tests/ui/cycle.rs:4:19 | diff --git a/testing/tests/ui/cycle2.stderr b/testing/tests/ui/cycle2.stderr index 08d135fe..ece5f3fc 100644 --- a/testing/tests/ui/cycle2.stderr +++ b/testing/tests/ui/cycle2.stderr @@ -1,5 +1,5 @@ error: cyclic dependency in graph [ - "\"$WORKSPACE/target/tests/trybuild/rinja_testing/templates/cycle1.html/" --> \"$WORKSPACE/target/tests/trybuild/rinja_testing/templates/cycle1.html/"", + "\"$DIR/templates/cycle1.html/" --> \"$DIR/templates/cycle1.html/"", ] --> tests/ui/cycle2.rs:4:19 | diff --git a/testing/tests/ui/include-a-folder.stderr b/testing/tests/ui/include-a-folder.stderr index 08a1cef8..aa491399 100644 --- a/testing/tests/ui/include-a-folder.stderr +++ b/testing/tests/ui/include-a-folder.stderr @@ -1,4 +1,4 @@ -error: unable to open template file '$WORKSPACE/target/tests/trybuild/rinja_testing/templates/a_file_that_is_actually_a_folder.html': Is a directory (os error 21) +error: unable to open template file '$DIR/templates/a_file_that_is_actually_a_folder.html': Is a directory (os error 21) --> YouCannotIncludeFolders.txt:1:2 " include \"a_file_that_is_actually_a_folder.html\" %}" --> tests/ui/include-a-folder.rs:4:34