1
1
mirror of https://github.com/tweag/nickel.git synced 2024-10-04 23:27:15 +03:00

add a test to test if relatives imports are working

This commit is contained in:
francois-caddet 2021-10-15 11:41:17 +02:00
parent 6795c152fe
commit eaee509fe8
4 changed files with 14 additions and 0 deletions

View File

@ -24,6 +24,17 @@ fn nested() {
assert_eq!(prog.eval(), Ok(Term::Num(3.)));
}
#[test]
fn root_path() {
use nickel::term::Term;
let mut prog = Program::new_from_source(
BufReader::new(mk_import("root_path.ncl").as_bytes()),
"should_be = 44",
)
.unwrap();
assert_eq!(prog.eval(), Ok(Term::Num(44.)));
}
#[test]
fn multi_imports() {
use nickel::term::Term;

View File

@ -0,0 +1 @@
import "root_path/import.ncl"

View File

@ -0,0 +1 @@
21 + 21

View File

@ -0,0 +1 @@
(import "fourtytwo.ncl") + (import "../two.ncl")