~qbit/protect

ref: 3679c9b4dea612c053eb13bbe80ec989674d4a97 protect/protect_test.go -rw-r--r-- 485 bytes
3679c9b4Aaron Bieber Add UnveilSet 2 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
28
29
package protect

import (
	"testing"
)

func TestReduce(t *testing.T) {
	expected := "stdio unix rpath cpath"
	a := "stdio tty unix unveil rpath cpath wpath"
	b := "unveil tty wpath"

	n, err := reduce(a, b)
	if err != nil {
		t.Error(err)
	}

	if n != expected {
		t.Errorf("reduce: expected %q got %q\n", expected, n)
	}

	c, err := reduce(n, "rpath cpath")
	if err != nil {
		t.Error(err)
	}

	if c != "stdio unix" {
		t.Errorf("reduce: expected %q got %q\n", "stdio unix", c)
	}
}