File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,6 @@ func parseInfo(pkg string, data []byte) *Info {
59
59
if err != nil {
60
60
panic (err )
61
61
}
62
- if len (results ) != 1 {
63
- panic (fmt .Sprintf ("unexpected number of results: %d" , len (results )))
64
- }
65
62
for _ , result := range results {
66
63
pkgInfo := & Info {
67
64
NixName : pkg ,
Original file line number Diff line number Diff line change
1
+ package nix
2
+
3
+ import "testing"
4
+
5
+ func TestPkgExists (t * testing.T ) {
6
+ // nix-env returns an empty JSON object instead of an error for some
7
+ // missing packages, which was leading to a panic. "rust" happens to be
8
+ // one of those packages.
9
+ pkg := "rust"
10
+ exists := PkgExists (pkg )
11
+ if exists {
12
+ t .Errorf ("got PkgExists(%q) = true, want false." , pkg )
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments