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:
parent
6795c152fe
commit
eaee509fe8
@ -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;
|
||||
|
1
tests/imports/root_path.ncl
Normal file
1
tests/imports/root_path.ncl
Normal file
@ -0,0 +1 @@
|
||||
import "root_path/import.ncl"
|
1
tests/imports/root_path/fourtytwo.ncl
Normal file
1
tests/imports/root_path/fourtytwo.ncl
Normal file
@ -0,0 +1 @@
|
||||
21 + 21
|
1
tests/imports/root_path/import.ncl
Normal file
1
tests/imports/root_path/import.ncl
Normal file
@ -0,0 +1 @@
|
||||
(import "fourtytwo.ncl") + (import "../two.ncl")
|
Loading…
Reference in New Issue
Block a user