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

Function test_load_ok

std/src/program.rs:727–750  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

725
726 #[test]
727 fn test_load_ok() {
728 let content = "line 1\n\n line 2\n";
729 for (explicit, canonical) in &[
730 ("foo", "MEMORY:foo.bas"),
731 ("foo.bas", "MEMORY:foo.bas"),
732 ("BAR", "MEMORY:BAR.BAS"),
733 ("BAR.BAS", "MEMORY:BAR.BAS"),
734 ("Baz", "MEMORY:Baz.bas"),
735 ] {
736 Tester::default()
737 .write_file("foo.bas", content)
738 .write_file("foo.bak", "")
739 .write_file("BAR.BAS", content)
740 .write_file("Baz.bas", content)
741 .run(format!(r#"LOAD "{}""#, explicit))
742 .expect_clear()
743 .expect_program(Some(*canonical), "line 1\n\n line 2\n")
744 .expect_file("MEMORY:/foo.bas", content)
745 .expect_file("MEMORY:/foo.bak", "")
746 .expect_file("MEMORY:/BAR.BAS", content)
747 .expect_file("MEMORY:/Baz.bas", content)
748 .check();
749 }
750 }
751
752 #[test]
753 fn test_load_dirty_no_name_abort() {

Callers

nothing calls this directly

Calls 6

expect_programMethod · 0.80
expect_clearMethod · 0.80
write_fileMethod · 0.80
checkMethod · 0.45
expect_fileMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected