diff options
| -rw-r--r-- | examples/backend-dialog.rs (renamed from tests/dialog.rs) | 19 | ||||
| -rw-r--r-- | examples/message.rs (renamed from tests/message.rs) | 8 | 
2 files changed, 8 insertions, 19 deletions
| diff --git a/tests/dialog.rs b/examples/backend-dialog.rs index 4c671f8..b6be492 100644 --- a/tests/dialog.rs +++ b/examples/backend-dialog.rs @@ -6,28 +6,21 @@ use std::io::Result;  use dialog::backends;  use dialog::DialogBox; -#[test] -fn message() -> Result<()> { +fn main() -> Result<()> { +    let mut backend = backends::Dialog::new(); +      dialog::Message::new("This is a message.")          .title("And this is a title:") -        .show_with(&backends::Dialog::new()) -} +        .show_with(&backend)?; -#[test] -fn backtitle() -> Result<()> { -    let mut backend = backends::Dialog::new();      backend.set_backtitle("Backtitle");      dialog::Message::new("This is a message.")          .title("And this is a title:") -        .show_with(&backend) -} +        .show_with(&backend)?; -#[test] -fn size() -> Result<()> { -    let mut backend = backends::Dialog::new();      backend.set_width(100);      backend.set_height(10); -    dialog::Message::new("This is a message.") +    dialog::Message::new("This is a message with a fixed size.")          .title("And this is a title:")          .show_with(&backend)  } diff --git a/tests/message.rs b/examples/message.rs index 4b1f18c..a72ef00 100644 --- a/tests/message.rs +++ b/examples/message.rs @@ -5,13 +5,9 @@ use std::io::Result;  use dialog::DialogBox; -#[test] -fn text() -> Result<()> { -    dialog::Message::new("This is a message.").show() -} +fn main() -> Result<()> { +    dialog::Message::new("This is a message.").show()?; -#[test] -fn text_title() -> Result<()> {      dialog::Message::new("This is a message.")          .title("And this is a title:")          .show() | 
