mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-23 18:21:38 +03:00
adds tests for imports
This commit is contained in:
parent
9cfc72519d
commit
3d62e6a191
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