1package executor
2
3import (
4	"testing"
5
6	"github.com/stretchr/testify/require"
7)
8
9func TestUtils_IsolationMode(t *testing.T) {
10	private := IsolationModePrivate
11	host := IsolationModeHost
12	blank := ""
13
14	for _, tc := range []struct {
15		plugin, task, exp string
16	}{
17		{plugin: private, task: private, exp: private},
18		{plugin: private, task: host, exp: host},
19		{plugin: private, task: blank, exp: private}, // default to private
20
21		{plugin: host, task: private, exp: private},
22		{plugin: host, task: host, exp: host},
23		{plugin: host, task: blank, exp: host}, // default to host
24	} {
25		result := IsolationMode(tc.plugin, tc.task)
26		require.Equal(t, tc.exp, result)
27	}
28}
29