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 5959 with :
6060 command : test
6161 args : --all --all-features
62+ - name : cargo-test-doc
63+ uses : actions-rs/cargo@v1
64+ with :
65+ command : test
66+ args : --doc
6267
6368
6469 deny :
Original file line number Diff line number Diff line change @@ -33,11 +33,11 @@ rexpect = "0.5"
3333
3434Simple example for interacting via ftp:
3535
36- ``` rust
36+ ``` rust,no_run
3737use rexpect::spawn;
3838use rexpect::error::*;
3939
40- fn do_ftp () -> Result <()> {
40+ fn do_ftp() -> Result<(), Error > {
4141 let mut p = spawn("ftp speedtest.tele2.net", Some(30_000))?;
4242 p.exp_regex("Name \\(.*\\):")?;
4343 p.send_line("anonymous")?;
@@ -60,11 +60,11 @@ fn main() {
6060
6161### Example with bash and reading from programs
6262
63- ``` rust
63+ ``` rust,no_run
6464use rexpect::spawn_bash;
6565use rexpect::error::*;
6666
67- fn do_bash () -> Result <()> {
67+ fn do_bash() -> Result<(), Error > {
6868 let mut p = spawn_bash(Some(2000))?;
6969
7070 // case 1: wait until program is done
@@ -110,11 +110,11 @@ goes into nirvana. There are two functions to ensure that:
110110
111111
112112
113- ``` rust
113+ ``` rust,no_run
114114use rexpect::spawn_bash;
115115use rexpect::error::*;
116116
117- fn do_bash_jobcontrol () -> Result <()> {
117+ fn do_bash_jobcontrol() -> Result<(), Error > {
118118 let mut p = spawn_bash(Some(1000))?;
119119 p.execute("ping 8.8.8.8", "bytes of data")?;
120120 p.send_control('z')?;
Original file line number Diff line number Diff line change @@ -71,3 +71,7 @@ pub mod session;
7171
7272pub use reader:: ReadUntil ;
7373pub 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