Beispiel #1
0
func TestName(t *testing.T) {
	debug = testing.Verbose()
	d := zx.Dir{
		"path":  "/a/b",
		"name":  "b",
		"type":  "d",
		"mode":  "0755",
		"spath": "/a/b",
		"tpath": "/tmp/lfs_test",
		"proto": "lfs",
	}
	preds := []string{
		`name=b`,
		`! name=b`,
		`name!=b`,
	}
	matches := []bool{true, false, false}
	prunes := []bool{false, true, true}
	for i, pr := range preds {
		p, err := New(pr)
		if err != nil {
			t.Fatalf("parse %s", err)
		}
		t.Logf("eval %s\n", p.DebugString())
		m, prune, err := p.EvalAt(d, 0)
		t.Logf("match %v prune %v sts %v", m, prune, err)
		if err != nil || m != matches[i] || prune != prunes[i] {
			t.Logf("wrong result %v %v %v", err, m, prune)
			t.Fail()
		}
	}
}
Beispiel #2
0
func GetMapErrorsTest() {
	t.Fail("not implemented")
}
Beispiel #3
0
func NewMapViewTest() {
	t.Fail("Not impelemented")
}