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

Function test_save_ok_explicit_name

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

Source from the content-addressed store, hash-verified

1137
1138 #[test]
1139 fn test_save_ok_explicit_name() {
1140 let content = "\n some line \n ";
1141 for (explicit, actual, canonical) in &[
1142 ("first", "MEMORY:/first.bas", "MEMORY:first.bas"),
1143 ("second.bas", "MEMORY:/second.bas", "MEMORY:second.bas"),
1144 ("THIRD", "MEMORY:/THIRD.BAS", "MEMORY:THIRD.BAS"),
1145 ("FOURTH.BAS", "MEMORY:/FOURTH.BAS", "MEMORY:FOURTH.BAS"),
1146 ("Fifth", "MEMORY:/Fifth.bas", "MEMORY:Fifth.bas"),
1147 ] {
1148 Tester::default()
1149 .set_program(Some("before.bas"), content)
1150 .run(format!(r#"SAVE "{}""#, explicit))
1151 .expect_program(Some(*canonical), content)
1152 .expect_prints([format!("Saved as {}", canonical)])
1153 .expect_file(*actual, content)
1154 .check();
1155 }
1156 }
1157
1158 #[test]
1159 fn test_save_reuse_name() {

Callers

nothing calls this directly

Calls 6

expect_programMethod · 0.80
set_programMethod · 0.80
checkMethod · 0.45
expect_fileMethod · 0.45
expect_printsMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected