Open desyncr opened 7 years ago
would'nt that mean running a local git server?
No need for that. git
doesn't need a server for it (unlike, subversion). Just a couple of commands away:
$ /tmp git init test-repo
Initialized empty Git repository in /private/tmp/test-repo/.git/
Then in /tmp/test-repo
you can perform all git commands you need, clone, commit.
very nice! Thanks for the tip.
so it just needs to had a .sh file with a hello_world function in it, then test the function?
Yeah, exactly, as we're not testing the plugins themselves, but how zpm
handles the cloning, listing, removal and so forth. We'll need to have at least two of them, in order to test properly.
If we need in the future we may have specific test repositories to test special cases, such as what happens if the plugin as no ".sh", for example.
Yes. Shouldn't we also test wether plugins contains _xxx file, or even file with #compdef xxx
for shebang?
that would probably mean reworking the plugin_entry function:
*.*sh
file.two more question:
- What's the way to test completions?
- Should'nt we use zpm directory to test both binary install and completion(once we have the ompletion file working.)?
I haven't tested completions ever. So there is a room for investigation. Maybe looking at https://github.com/zsh-users/zsh-autosuggestions would give us a clue.
Yes. Shouldn't we also test wether plugins contains _xxx file, or even file with #compdef xxx for shebang?
Yeah, those are great ideas. Should target v1.0.0
.
I use zpm self install feature, which puts zpm
in the PATH
, along with a small (and full of sxxx)
_zpm
completion file, and it works well.
To me, the question remains: how do we test it programmtically?
We should probably use gist to share _zpm
file while working on it, like we did for .travis.yml
A working _zpm
is better than nothing. So please go ahead and create a PR.
I'm working on test's performance.
Currently our test suite does real network access. This make test run extra slow and make them unavailable working offline.
The idea is to create some
git
repositories at run-time and accessing them, now thatzpm
supports local repositories.TODO
remove.t
tests