~egtann/binp

binp/binp_test.go -rw-r--r-- 536 bytes
7746a19a — Evan Tann fix net name in test services file 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package binp

import (
	"path/filepath"
	"testing"
)

func TestPack(t *testing.T) {
	pth := filepath.Join("testdata", "services.json")
	c, err := ParseConfig(pth)
	if err != nil {
		t.Fatal(err)
	}
	boxsets, err := c.Pack()
	if err != nil {
		t.Fatal(err)
	}
	if len(boxsets) != 2 {
		t.Fatalf("want len(boxsets) = 2, got %d", len(boxsets))
	}
	if ln := len(boxsets["openbsd"]); ln != 6 {
		t.Fatalf("want len(openbsd) = 6, got %d", ln)
	}
	if ln := len(boxsets["debian"]); ln != 1 {
		t.Fatalf("want len(debian) = 1, got %d", ln)
	}
}