Skip to content

Commit adf5996

Browse files
committed
Add basic rust-side test
1 parent c13f830 commit adf5996

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/deno_dir.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,26 @@ fn test_code_fetch() {
448448
//println!("code_fetch_output {:?}", code_fetch_output);
449449
}
450450

451+
#[test]
452+
fn test_code_fetch_no_ext() {
453+
let (_temp_dir, deno_dir) = test_setup();
454+
455+
let cwd = std::env::current_dir().unwrap();
456+
let cwd_string = String::from(cwd.to_str().unwrap()) + "/";
457+
458+
// Assuming cwd is the deno repo root.
459+
let module_specifier = "./js/main";
460+
let containing_file = cwd_string.as_str();
461+
let r = deno_dir.code_fetch(module_specifier, containing_file);
462+
assert!(r.is_ok());
463+
464+
// Assuming cwd is the deno repo root.
465+
let module_specifier = "./js/mock_builtin";
466+
let containing_file = cwd_string.as_str();
467+
let r = deno_dir.code_fetch(module_specifier, containing_file);
468+
assert!(r.is_ok());
469+
}
470+
451471
#[test]
452472
fn test_src_file_to_url_1() {
453473
let (_temp_dir, deno_dir) = test_setup();

0 commit comments

Comments
 (0)