mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-25 11:12:48 +03:00
Merge pull request #901 from AleoHQ/more-cli-tests
[CLI] Adds tests for imports
This commit is contained in:
commit
5e281bf93d
17
leo/main.rs
17
leo/main.rs
@ -358,6 +358,23 @@ mod cli_tests {
|
||||
assert!(run_cmd("leo clean", setup_path).is_ok());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_import() {
|
||||
let dir = testdir("test");
|
||||
let path = dir.path("test");
|
||||
|
||||
assert!(run_cmd("leo new import", &Some(path.clone())).is_ok());
|
||||
|
||||
let import_path = &Some(path.join("import"));
|
||||
|
||||
assert!(run_cmd("leo add no-package/definitely-no", import_path).is_err());
|
||||
assert!(run_cmd("leo add justice-league/u8u32", import_path).is_ok());
|
||||
assert!(run_cmd("leo remove u8u32", import_path).is_ok());
|
||||
assert!(run_cmd("leo add --author justice-league --package u8u32", import_path).is_ok());
|
||||
assert!(run_cmd("leo remove u8u32", import_path).is_ok());
|
||||
assert!(run_cmd("leo remove u8u32", import_path).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_missing_file() {
|
||||
let dir = testdir("test");
|
||||
|
Loading…
Reference in New Issue
Block a user