| 1 | // vtest retry: 3 |
| 2 | import os |
| 3 | import rand |
| 4 | import test_utils |
| 5 | |
| 6 | const vexe = os.quoted_path(@VEXE) |
| 7 | const test_path = os.join_path(os.vtmp_dir(), 'vpm_remove_test_${rand.ulid()}') |
| 8 | |
| 9 | fn testsuite_begin() { |
| 10 | $if !network ? { |
| 11 | eprintln('> skipping ${@FILE}, when `-d network` is missing') |
| 12 | exit(0) |
| 13 | } |
| 14 | dump(test_path) |
| 15 | test_utils.set_test_env(test_path) |
| 16 | } |
| 17 | |
| 18 | fn testsuite_end() { |
| 19 | os.rmdir_all(test_path) or {} |
| 20 | } |
| 21 | |
| 22 | fn test_remove() { |
| 23 | os.execute_or_exit('${vexe} install https://github.com/hungrybluedev/xlsx') |
| 24 | mod_path := os.join_path(test_path, 'xlsx') |
| 25 | assert os.is_dir(mod_path) |
| 26 | res := os.execute('${vexe} remove xlsx') |
| 27 | assert !os.exists(mod_path) |
| 28 | } |
| 29 | |