diff options
| author | Nicholas Rodrigues Lordello <[email protected]> | 2021-08-21 07:35:13 +0000 |
|---|---|---|
| committer | Nicholas Rodrigues Lordello <[email protected]> | 2021-08-21 07:35:13 +0000 |
| commit | f608cce748d80d46f49ba25999e4334fd959b070 (patch) | |
| tree | 9fc73440b321933cfd6e6ead10ee18d93bc99c89 /tests/new.rs | |
| parent | c05487949a5cb9808945b5bdd174e14fdd7e51ea (diff) | |
Refactor into lib+bin and start adding e2e tests
Diffstat (limited to 'tests/new.rs')
| -rw-r--r-- | tests/new.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/new.rs b/tests/new.rs new file mode 100644 index 0000000..4ddbf0c --- /dev/null +++ b/tests/new.rs @@ -0,0 +1,20 @@ +mod util; + +use hdwallet::mnemonic::Mnemonic; + +#[test] +fn generates_random_mnemonic() { + let mnemonic = util::exec("new", &[]); + assert!(Mnemonic::from_phrase(mnemonic).is_ok()) +} + +#[test] +fn errors_on_invalid_language() { + assert!(util::try_exec("new", &["--language", "klingon"]).is_err()); +} + +#[test] +fn errors_on_invalid_length() { + assert!(util::try_exec("new", &["--length", "1"]).is_err()); + assert!(util::try_exec("new", &["--length", "42"]).is_err()); +}
\ No newline at end of file |
