MCPcopy Index your code
hub / github.com/endbasic/endbasic / test_run_from_storage_path_no_repl

Function test_run_from_storage_path_no_repl

repl/src/lib.rs:492–519  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

490
491 #[test]
492 fn test_run_from_storage_path_no_repl() {
493 let tester = Tester::default();
494 let (console, storage, program) =
495 (tester.get_console(), tester.get_storage(), tester.get_program());
496 let mut continuation = tester.continue_from_here();
497
498 storage.borrow_mut().mount("SOME", "memory://").unwrap();
499 block_on(storage.borrow_mut().put("SOME:bar.bas", MockDriveFactory::SCRIPT.as_bytes()))
500 .unwrap();
501
502 block_on(run_from_storage_path(
503 continuation.get_machine(),
504 console,
505 storage,
506 program,
507 "some:bar.bas",
508 false,
509 ))
510 .unwrap();
511 continuation
512 .run("")
513 .expect_prints(["Loading SOME:bar.bas...", "Starting...", ""])
514 .expect_clear()
515 .expect_prints(["Success", "", "**** Program exited due to EOF ****"])
516 .expect_file("SOME:/bar.bas", MockDriveFactory::SCRIPT)
517 .expect_program(Some("SOME:bar.bas"), MockDriveFactory::SCRIPT)
518 .check();
519 }
520
521 #[test]
522 fn test_run_from_storage_path_with_default_extension_and_repl() {

Callers

nothing calls this directly

Calls 15

run_from_storage_pathFunction · 0.85
continue_from_hereMethod · 0.80
mountMethod · 0.80
as_bytesMethod · 0.80
get_machineMethod · 0.80
expect_programMethod · 0.80
expect_clearMethod · 0.80
get_consoleMethod · 0.45
get_storageMethod · 0.45
get_programMethod · 0.45
putMethod · 0.45
checkMethod · 0.45

Tested by

no test coverage detected