From 0f022c100b49f9434954fd2494ea862a10d32237 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 12 Sep 2023 15:18:54 +0200 Subject: [PATCH] Allow different path for vs code. (#589) --- compiler/tests/pil.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/tests/pil.rs b/compiler/tests/pil.rs index d980b59c3..0b3826843 100644 --- a/compiler/tests/pil.rs +++ b/compiler/tests/pil.rs @@ -4,7 +4,13 @@ use std::path::Path; use test_log::test; pub fn verify_pil(file_name: &str, query_callback: Option Option>) { - let input_file = Path::new(&format!("../test_data/pil/{file_name}")) + let input_file = [".", ".."] + .into_iter() + .find_map(|p| { + let path = Path::new(&format!("{p}/test_data/pil/{file_name}")).to_owned(); + path.exists().then_some(path.to_owned()) + }) + .unwrap() .canonicalize() .unwrap();