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

Function test_dir_other_by_argument

std/src/storage/cmds.rs:707–745  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

705
706 #[test]
707 fn test_dir_other_by_argument() {
708 let mut other = InMemoryDrive::default();
709 block_on(other.put("foo.bas", b"hello")).unwrap();
710
711 let mut t = Tester::default().write_file("empty.bas", "");
712 t.get_storage().borrow_mut().attach("other", "z://", Box::from(other)).unwrap();
713
714 let mut prints = vec![
715 "",
716 " Directory of MEMORY:/",
717 "",
718 " Modified Size Name",
719 " 2020-05-06 09:37 0 empty.bas",
720 "",
721 " 1 file(s), 0 bytes",
722 "",
723 ];
724 t.run("DIR \"memory:\"")
725 .expect_prints(prints.clone())
726 .expect_file("MEMORY:/empty.bas", "")
727 .expect_file("OTHER:/foo.bas", "hello")
728 .check();
729
730 prints.extend([
731 "",
732 " Directory of OTHER:/",
733 "",
734 " Modified Size Name",
735 " 2020-05-06 09:37 5 foo.bas",
736 "",
737 " 1 file(s), 5 bytes",
738 "",
739 ]);
740 t.run("DIR \"other:/\"")
741 .expect_prints(prints)
742 .expect_file("MEMORY:/empty.bas", "")
743 .expect_file("OTHER:/foo.bas", "hello")
744 .check();
745 }
746
747 #[test]
748 fn test_dir_other_by_cwd() {

Callers

nothing calls this directly

Calls 8

write_fileMethod · 0.80
attachMethod · 0.80
putMethod · 0.45
get_storageMethod · 0.45
checkMethod · 0.45
expect_fileMethod · 0.45
expect_printsMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected