| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::envrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/::varrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var().; |
| 2 | |
| 3 | use clearscreenrust-analyzer cargo clearscreen 4.0.2 crate/::ClearScreenrust-analyzer cargo clearscreen 4.0.2 ClearScreen#; |
| 4 | |
| 5 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 6 | fn terminforust-analyzer cargo clearscreen 4.0.2 terminfo().() { |
| 7 | if varrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var().("TERM").is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().() && (cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(unix) || varrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var().("TERMINFO").is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().()) { |
| 8 | ClearScreenrust-analyzer cargo clearscreen 4.0.2 ClearScreen#::Terminforust-analyzer cargo clearscreen 4.0.2 ClearScreen#Terminfo#.clearrust-analyzer cargo clearscreen 4.0.2 impl#[ClearScreen]clear().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 13 | fn terminfo_screenrust-analyzer cargo clearscreen 4.0.2 terminfo_screen().() { |
| 14 | if varrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var().("TERM").is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().() && (cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(unix) || varrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var().("TERMINFO").is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().()) { |
| 15 | ClearScreenrust-analyzer cargo clearscreen 4.0.2 ClearScreen#::TerminfoScreenrust-analyzer cargo clearscreen 4.0.2 ClearScreen#TerminfoScreen#.clearrust-analyzer cargo clearscreen 4.0.2 impl#[ClearScreen]clear().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 20 | fn terminfo_scrollbackrust-analyzer cargo clearscreen 4.0.2 terminfo_scrollback().() { |
| 21 | if varrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var().("TERM").is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().() && (cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(unix) || varrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var().("TERMINFO").is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().()) { |
| 22 | ClearScreenrust-analyzer cargo clearscreen 4.0.2 ClearScreen#::TerminfoScrollbackrust-analyzer cargo clearscreen 4.0.2 ClearScreen#TerminfoScrollback#.clearrust-analyzer cargo clearscreen 4.0.2 impl#[ClearScreen]clear().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 27 | fn terminfo_resetrust-analyzer cargo clearscreen 4.0.2 terminfo_reset().() { |
| 28 | if varrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var().("TERM").is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().() && (cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(unix) || varrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var().("TERMINFO").is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().()) { |
| 29 | ClearScreenrust-analyzer cargo clearscreen 4.0.2 ClearScreen#::TerminfoResetrust-analyzer cargo clearscreen 4.0.2 ClearScreen#TerminfoReset#.clearrust-analyzer cargo clearscreen 4.0.2 impl#[ClearScreen]clear().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 34 | fn xterm_clearrust-analyzer cargo clearscreen 4.0.2 xterm_clear().() { |
| 35 | ClearScreenrust-analyzer cargo clearscreen 4.0.2 ClearScreen#::XtermClearrust-analyzer cargo clearscreen 4.0.2 ClearScreen#XtermClear#.clearrust-analyzer cargo clearscreen 4.0.2 impl#[ClearScreen]clear().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 36 | } |
| 37 | |
| 38 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 39 | fn xterm_resetrust-analyzer cargo clearscreen 4.0.2 xterm_reset().() { |
| 40 | ClearScreenrust-analyzer cargo clearscreen 4.0.2 ClearScreen#::XtermResetrust-analyzer cargo clearscreen 4.0.2 ClearScreen#XtermReset#.clearrust-analyzer cargo clearscreen 4.0.2 impl#[ClearScreen]clear().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 41 | } |
| 42 | |
| 43 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 44 | fn tput_clearrust-analyzer cargo clearscreen 4.0.2 tput_clear().() { |
| 45 | if varrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var().("TERM").is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().() && (cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(unix) || varrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var().("TERMINFO").is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().()) { |
| 46 | ClearScreenrust-analyzer cargo clearscreen 4.0.2 ClearScreen#::TputClearrust-analyzer cargo clearscreen 4.0.2 ClearScreen#TputClear#.clearrust-analyzer cargo clearscreen 4.0.2 impl#[ClearScreen]clear().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 51 | fn tput_resetrust-analyzer cargo clearscreen 4.0.2 tput_reset().() { |
| 52 | if varrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var().("TERM").is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().() && (cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(unix) || varrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var().("TERMINFO").is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().()) { |
| 53 | ClearScreenrust-analyzer cargo clearscreen 4.0.2 ClearScreen#::TputResetrust-analyzer cargo clearscreen 4.0.2 ClearScreen#TputReset#.clearrust-analyzer cargo clearscreen 4.0.2 impl#[ClearScreen]clear().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | #[cfg(windows)] |
| 58 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 59 | fn windows_cls() { |
| 60 | ClearScreenrust-analyzer cargo clearscreen 4.0.2 ClearScreen#::Clsrust-analyzer cargo clearscreen 4.0.2 ClearScreen#Cls#.clear().unwrap(); |
| 61 | } |
| 62 | |
| 63 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 64 | fn windows_vtrust-analyzer cargo clearscreen 4.0.2 windows_vt().() { |
| 65 | ClearScreenrust-analyzer cargo clearscreen 4.0.2 ClearScreen#::WindowsVtrust-analyzer cargo clearscreen 4.0.2 ClearScreen#WindowsVt#.clearrust-analyzer cargo clearscreen 4.0.2 impl#[ClearScreen]clear().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 66 | } |
| 67 | |
| 68 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 69 | fn windows_vt_clearrust-analyzer cargo clearscreen 4.0.2 windows_vt_clear().() { |
| 70 | ClearScreenrust-analyzer cargo clearscreen 4.0.2 ClearScreen#::WindowsVtClearrust-analyzer cargo clearscreen 4.0.2 ClearScreen#WindowsVtClear#.clearrust-analyzer cargo clearscreen 4.0.2 impl#[ClearScreen]clear().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 71 | } |
| 72 | |
| 73 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 74 | fn vt_risrust-analyzer cargo clearscreen 4.0.2 vt_ris().() { |
| 75 | ClearScreenrust-analyzer cargo clearscreen 4.0.2 ClearScreen#::VtRisrust-analyzer cargo clearscreen 4.0.2 ClearScreen#VtRis#.clearrust-analyzer cargo clearscreen 4.0.2 impl#[ClearScreen]clear().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 76 | } |
| 77 | |
| 78 | // TODO: test these under Win8? why don't they work |
| 79 | // |
| 80 | // #[test] |
| 81 | // fn windows_console_clear() { |
| 82 | // ClearScreen::WindowsConsoleClear.clear().unwrap(); |
| 83 | // } |
| 84 | // |
| 85 | // #[test] |
| 86 | // fn windows_console_blank() { |
| 87 | // ClearScreen::WindowsConsoleBlank.clear().unwrap(); |
| 88 | // } |