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

Function test_help_paging

std/src/help.rs:1031–1074  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1029
1030 #[test]
1031 fn test_help_paging() {
1032 let mut t = tester();
1033 t.get_console().borrow_mut().set_interactive(true);
1034 t.get_console().borrow_mut().set_size_chars(CharsXY { x: 80, y: 9 });
1035 t.get_console().borrow_mut().add_input_keys(&[Key::NewLine]);
1036 t.get_console().borrow_mut().set_color(Some(100), Some(200)).unwrap();
1037 t.run("HELP")
1038 .expect_output([CapturedOut::SetColor(Some(100), Some(200))])
1039 .expect_prints(header())
1040 .expect_prints([""])
1041 .expect_output([
1042 CapturedOut::SetColor(Some(TITLE_COLOR), Some(200)),
1043 CapturedOut::Print(" Top-level help topics".to_owned()),
1044 CapturedOut::SetColor(Some(100), Some(200)),
1045 ])
1046 .expect_prints([""])
1047 .expect_output([CapturedOut::Print(
1048 " << Press any key for more; ESC or Ctrl+C to stop >> ".to_owned(),
1049 )])
1050 .expect_output([
1051 CapturedOut::Write(" >> ".to_owned()),
1052 CapturedOut::SetColor(Some(LINK_COLOR), Some(200)),
1053 CapturedOut::Print("Interpreter".to_owned()),
1054 CapturedOut::SetColor(Some(100), Some(200)),
1055 ])
1056 .expect_output([
1057 CapturedOut::Write(" >> ".to_owned()),
1058 CapturedOut::SetColor(Some(LINK_COLOR), Some(200)),
1059 CapturedOut::Print("Language reference".to_owned()),
1060 CapturedOut::SetColor(Some(100), Some(200)),
1061 ])
1062 .expect_prints([
1063 "",
1064 " Type HELP followed by the name of a topic for details.",
1065 " Type HELP \"HELP\" for details on how to specify topic names.",
1066 " Type LOAD \"DEMOS:/TOUR.BAS\": RUN for a guided tour.",
1067 " Type END or press CTRL+D to exit.",
1068 "",
1069 ])
1070 .expect_output([CapturedOut::Print(
1071 " << Press any key for more; ESC or Ctrl+C to stop >> ".to_owned(),
1072 )])
1073 .check();
1074 }
1075}

Callers

nothing calls this directly

Calls 11

testerFunction · 0.85
headerFunction · 0.85
set_interactiveMethod · 0.80
add_input_keysMethod · 0.80
get_consoleMethod · 0.45
set_size_charsMethod · 0.45
set_colorMethod · 0.45
checkMethod · 0.45
expect_outputMethod · 0.45
expect_printsMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected