File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 59
59
with :
60
60
command : test
61
61
args : --all --all-features
62
+ - name : cargo-test-doc
63
+ uses : actions-rs/cargo@v1
64
+ with :
65
+ command : test
66
+ args : --doc
62
67
63
68
64
69
deny :
Original file line number Diff line number Diff line change @@ -33,11 +33,11 @@ rexpect = "0.5"
33
33
34
34
Simple example for interacting via ftp:
35
35
36
- ``` rust
36
+ ``` rust,no_run
37
37
use rexpect::spawn;
38
38
use rexpect::error::*;
39
39
40
- fn do_ftp () -> Result <()> {
40
+ fn do_ftp() -> Result<(), Error > {
41
41
let mut p = spawn("ftp speedtest.tele2.net", Some(30_000))?;
42
42
p.exp_regex("Name \\(.*\\):")?;
43
43
p.send_line("anonymous")?;
@@ -60,11 +60,11 @@ fn main() {
60
60
61
61
### Example with bash and reading from programs
62
62
63
- ``` rust
63
+ ``` rust,no_run
64
64
use rexpect::spawn_bash;
65
65
use rexpect::error::*;
66
66
67
- fn do_bash () -> Result <()> {
67
+ fn do_bash() -> Result<(), Error > {
68
68
let mut p = spawn_bash(Some(2000))?;
69
69
70
70
// case 1: wait until program is done
@@ -110,11 +110,11 @@ goes into nirvana. There are two functions to ensure that:
110
110
111
111
112
112
113
- ``` rust
113
+ ``` rust,no_run
114
114
use rexpect::spawn_bash;
115
115
use rexpect::error::*;
116
116
117
- fn do_bash_jobcontrol () -> Result <()> {
117
+ fn do_bash_jobcontrol() -> Result<(), Error > {
118
118
let mut p = spawn_bash(Some(1000))?;
119
119
p.execute("ping 8.8.8.8", "bytes of data")?;
120
120
p.send_control('z')?;
Original file line number Diff line number Diff line change @@ -71,3 +71,7 @@ pub mod session;
71
71
72
72
pub use reader:: ReadUntil ;
73
73
pub use session:: { spawn, spawn_bash, spawn_python, spawn_stream} ;
74
+
75
+ // include the README.md here to test its doc
76
+ #[ doc = include_str ! ( "../README.md" ) ]
77
+ mod test { }
You can’t perform that action at this time.
0 commit comments