| 1 |
We setup a simple mock repository directory with a couple of packages. |
| 2 |
|
| 3 |
$ mkrepo |
| 4 |
$ mkpkg foo |
| 5 |
$ mkpkg bar <<EOF |
| 6 |
> depends: [ "foo" {>= "0.0.1"} ] |
| 7 |
> synopsis: "Mock bar package that depends on foo." |
| 8 |
> EOF |
| 9 |
|
| 10 |
Create a dune-workspace with a the mock repository added |
| 11 |
|
| 12 |
$ add_mock_repo_if_needed |
| 13 |
|
| 14 |
Search without any query arguments |
| 15 |
|
| 16 |
$ dune pkg search |
| 17 |
- bar 0.0.1 Mock bar package that depends on foo. |
| 18 |
- foo 0.0.1 (no synopsis) |
| 19 |
|
| 20 |
Search with a query argument -- exact name |
| 21 |
|
| 22 |
$ dune pkg search foo |
| 23 |
- foo 0.0.1 (no synopsis) |
| 24 |
|
| 25 |
Another search with a query argument - substring of package name, upper-cased |
| 26 |
since the search is caseless. |
| 27 |
|
| 28 |
$ dune pkg search 'ar' |
| 29 |
- bar 0.0.1 Mock bar package that depends on foo. |
| 30 |
|
| 31 |
Search with no results |
| 32 |
|
| 33 |
$ dune pkg search baz |
| 34 |
Error: No packages found matching "baz". |
| 35 |
[1] |
| 36 |
|
| 37 |
Search for all packages |
| 38 |
|
| 39 |
$ dune pkg search |
| 40 |
- bar 0.0.1 Mock bar package that depends on foo. |
| 41 |
- foo 0.0.1 (no synopsis) |