File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff 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]
452472fn test_src_file_to_url_1 ( ) {
453473 let ( _temp_dir, deno_dir) = test_setup ( ) ;
You can’t perform that action at this time.
0 commit comments