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

Function test_dir_other_by_cwd

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

Source from the content-addressed store, hash-verified

746
747 #[test]
748 fn test_dir_other_by_cwd() {
749 let mut other = InMemoryDrive::default();
750 block_on(other.put("foo.bas", b"hello")).unwrap();
751
752 let mut t = Tester::default().write_file("empty.bas", "");
753 t.get_storage().borrow_mut().attach("other", "z://", Box::from(other)).unwrap();
754
755 let mut prints = vec![
756 "",
757 " Directory of MEMORY:/",
758 "",
759 " Modified Size Name",
760 " 2020-05-06 09:37 0 empty.bas",
761 "",
762 " 1 file(s), 0 bytes",
763 "",
764 ];
765 t.run("DIR")
766 .expect_prints(prints.clone())
767 .expect_file("MEMORY:/empty.bas", "")
768 .expect_file("OTHER:/foo.bas", "hello")
769 .check();
770
771 t.get_storage().borrow_mut().cd("other:/").unwrap();
772 prints.extend([
773 "",
774 " Directory of OTHER:/",
775 "",
776 " Modified Size Name",
777 " 2020-05-06 09:37 5 foo.bas",
778 "",
779 " 1 file(s), 5 bytes",
780 "",
781 ]);
782 t.run("DIR")
783 .expect_prints(prints)
784 .expect_file("MEMORY:/empty.bas", "")
785 .expect_file("OTHER:/foo.bas", "hello")
786 .check();
787 }
788
789 #[test]
790 fn test_dir_narrow_empty() {

Callers

nothing calls this directly

Calls 9

write_fileMethod · 0.80
attachMethod · 0.80
cdMethod · 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