refactor: tidy; fix runtime path resolution
This commit is contained in:
@@ -110,10 +110,7 @@ fn test_path_with_file() {
|
||||
let test_file = temp_dir.path().join("test.txt");
|
||||
std::fs::write(&test_file, "Hello, World!").unwrap();
|
||||
|
||||
let expr = format!(
|
||||
r#"builtins.path {{ path = {}; }}"#,
|
||||
test_file.display()
|
||||
);
|
||||
let expr = format!(r#"builtins.path {{ path = {}; }}"#, test_file.display());
|
||||
let result = ctx.eval_code(&expr).unwrap();
|
||||
|
||||
// Should return a store path string
|
||||
@@ -239,10 +236,7 @@ fn test_path_with_sha256() {
|
||||
std::fs::write(&test_file, "Test content for hashing").unwrap();
|
||||
|
||||
// First, get the hash by calling without sha256
|
||||
let expr1 = format!(
|
||||
r#"builtins.path {{ path = {}; }}"#,
|
||||
test_file.display()
|
||||
);
|
||||
let expr1 = format!(r#"builtins.path {{ path = {}; }}"#, test_file.display());
|
||||
let result1 = ctx.eval_code(&expr1).unwrap();
|
||||
let store_path1 = match result1 {
|
||||
Value::String(s) => s,
|
||||
@@ -251,10 +245,7 @@ fn test_path_with_sha256() {
|
||||
|
||||
// Compute the actual hash (for testing, we'll just verify the same path is returned)
|
||||
// In real usage, the user would know the hash beforehand
|
||||
let expr2 = format!(
|
||||
r#"builtins.path {{ path = {}; }}"#,
|
||||
test_file.display()
|
||||
);
|
||||
let expr2 = format!(r#"builtins.path {{ path = {}; }}"#, test_file.display());
|
||||
let result2 = ctx.eval_code(&expr2).unwrap();
|
||||
let store_path2 = match result2 {
|
||||
Value::String(s) => s,
|
||||
|
||||
Reference in New Issue
Block a user