@@ -6,32 +6,33 @@ import (
6
6
7
7
"github.com/stretchr/testify/assert"
8
8
"github.com/stretchr/testify/require"
9
+ "github.com/ubuntu/gowsl/internal/flags"
9
10
)
10
11
11
12
func TestUnpackFlags (t * testing.T ) {
12
13
t .Parallel ()
13
14
14
15
tests := []struct {
15
16
wants Configuration
16
- input wslFlags
17
+ input flags. WslFlags
17
18
}{
18
- {input : wslFlags (0x0 ), wants : Configuration {InteropEnabled : false , PathAppended : false , DriveMountingEnabled : false }},
19
- {input : wslFlags (0x1 ), wants : Configuration {InteropEnabled : true , PathAppended : false , DriveMountingEnabled : false }},
20
- {input : wslFlags (0x2 ), wants : Configuration {InteropEnabled : false , PathAppended : true , DriveMountingEnabled : false }},
21
- {input : wslFlags (0x3 ), wants : Configuration {InteropEnabled : true , PathAppended : true , DriveMountingEnabled : false }},
22
- {input : wslFlags (0x4 ), wants : Configuration {InteropEnabled : false , PathAppended : false , DriveMountingEnabled : true }},
23
- {input : wslFlags (0x5 ), wants : Configuration {InteropEnabled : true , PathAppended : false , DriveMountingEnabled : true }},
24
- {input : wslFlags (0x6 ), wants : Configuration {InteropEnabled : false , PathAppended : true , DriveMountingEnabled : true }},
25
- {input : wslFlags (0x7 ), wants : Configuration {InteropEnabled : true , PathAppended : true , DriveMountingEnabled : true }},
19
+ {input : flags . WslFlags (0x0 ), wants : Configuration {InteropEnabled : false , PathAppended : false , DriveMountingEnabled : false }},
20
+ {input : flags . WslFlags (0x1 ), wants : Configuration {InteropEnabled : true , PathAppended : false , DriveMountingEnabled : false }},
21
+ {input : flags . WslFlags (0x2 ), wants : Configuration {InteropEnabled : false , PathAppended : true , DriveMountingEnabled : false }},
22
+ {input : flags . WslFlags (0x3 ), wants : Configuration {InteropEnabled : true , PathAppended : true , DriveMountingEnabled : false }},
23
+ {input : flags . WslFlags (0x4 ), wants : Configuration {InteropEnabled : false , PathAppended : false , DriveMountingEnabled : true }},
24
+ {input : flags . WslFlags (0x5 ), wants : Configuration {InteropEnabled : true , PathAppended : false , DriveMountingEnabled : true }},
25
+ {input : flags . WslFlags (0x6 ), wants : Configuration {InteropEnabled : false , PathAppended : true , DriveMountingEnabled : true }},
26
+ {input : flags . WslFlags (0x7 ), wants : Configuration {InteropEnabled : true , PathAppended : true , DriveMountingEnabled : true }},
26
27
// The following may be encountered due to an undocumented fourth flag
27
- {input : wslFlags (0x8 ), wants : Configuration {InteropEnabled : false , PathAppended : false , DriveMountingEnabled : false }},
28
- {input : wslFlags (0x9 ), wants : Configuration {InteropEnabled : true , PathAppended : false , DriveMountingEnabled : false }},
29
- {input : wslFlags (0xa ), wants : Configuration {InteropEnabled : false , PathAppended : true , DriveMountingEnabled : false }},
30
- {input : wslFlags (0xb ), wants : Configuration {InteropEnabled : true , PathAppended : true , DriveMountingEnabled : false }},
31
- {input : wslFlags (0xc ), wants : Configuration {InteropEnabled : false , PathAppended : false , DriveMountingEnabled : true }},
32
- {input : wslFlags (0xd ), wants : Configuration {InteropEnabled : true , PathAppended : false , DriveMountingEnabled : true }},
33
- {input : wslFlags (0xe ), wants : Configuration {InteropEnabled : false , PathAppended : true , DriveMountingEnabled : true }},
34
- {input : wslFlags (0xf ), wants : Configuration {InteropEnabled : true , PathAppended : true , DriveMountingEnabled : true }},
28
+ {input : flags . WslFlags (0x8 ), wants : Configuration {InteropEnabled : false , PathAppended : false , DriveMountingEnabled : false }},
29
+ {input : flags . WslFlags (0x9 ), wants : Configuration {InteropEnabled : true , PathAppended : false , DriveMountingEnabled : false }},
30
+ {input : flags . WslFlags (0xa ), wants : Configuration {InteropEnabled : false , PathAppended : true , DriveMountingEnabled : false }},
31
+ {input : flags . WslFlags (0xb ), wants : Configuration {InteropEnabled : true , PathAppended : true , DriveMountingEnabled : false }},
32
+ {input : flags . WslFlags (0xc ), wants : Configuration {InteropEnabled : false , PathAppended : false , DriveMountingEnabled : true }},
33
+ {input : flags . WslFlags (0xd ), wants : Configuration {InteropEnabled : true , PathAppended : false , DriveMountingEnabled : true }},
34
+ {input : flags . WslFlags (0xe ), wants : Configuration {InteropEnabled : false , PathAppended : true , DriveMountingEnabled : true }},
35
+ {input : flags . WslFlags (0xf ), wants : Configuration {InteropEnabled : true , PathAppended : true , DriveMountingEnabled : true }},
35
36
}
36
37
37
38
for _ , tc := range tests {
@@ -51,16 +52,16 @@ func TestPackFlags(t *testing.T) {
51
52
t .Parallel ()
52
53
tests := []struct {
53
54
input Configuration
54
- wants wslFlags
55
+ wants flags. WslFlags
55
56
}{
56
- {wants : wslFlags (0x0 ), input : Configuration {InteropEnabled : false , PathAppended : false , DriveMountingEnabled : false }},
57
- {wants : wslFlags (0x1 ), input : Configuration {InteropEnabled : true , PathAppended : false , DriveMountingEnabled : false }},
58
- {wants : wslFlags (0x2 ), input : Configuration {InteropEnabled : false , PathAppended : true , DriveMountingEnabled : false }},
59
- {wants : wslFlags (0x3 ), input : Configuration {InteropEnabled : true , PathAppended : true , DriveMountingEnabled : false }},
60
- {wants : wslFlags (0x4 ), input : Configuration {InteropEnabled : false , PathAppended : false , DriveMountingEnabled : true }},
61
- {wants : wslFlags (0x5 ), input : Configuration {InteropEnabled : true , PathAppended : false , DriveMountingEnabled : true }},
62
- {wants : wslFlags (0x6 ), input : Configuration {InteropEnabled : false , PathAppended : true , DriveMountingEnabled : true }},
63
- {wants : wslFlags (0x7 ), input : Configuration {InteropEnabled : true , PathAppended : true , DriveMountingEnabled : true }},
57
+ {wants : flags . WslFlags (0x0 ), input : Configuration {InteropEnabled : false , PathAppended : false , DriveMountingEnabled : false }},
58
+ {wants : flags . WslFlags (0x1 ), input : Configuration {InteropEnabled : true , PathAppended : false , DriveMountingEnabled : false }},
59
+ {wants : flags . WslFlags (0x2 ), input : Configuration {InteropEnabled : false , PathAppended : true , DriveMountingEnabled : false }},
60
+ {wants : flags . WslFlags (0x3 ), input : Configuration {InteropEnabled : true , PathAppended : true , DriveMountingEnabled : false }},
61
+ {wants : flags . WslFlags (0x4 ), input : Configuration {InteropEnabled : false , PathAppended : false , DriveMountingEnabled : true }},
62
+ {wants : flags . WslFlags (0x5 ), input : Configuration {InteropEnabled : true , PathAppended : false , DriveMountingEnabled : true }},
63
+ {wants : flags . WslFlags (0x6 ), input : Configuration {InteropEnabled : false , PathAppended : true , DriveMountingEnabled : true }},
64
+ {wants : flags . WslFlags (0x7 ), input : Configuration {InteropEnabled : true , PathAppended : true , DriveMountingEnabled : true }},
64
65
}
65
66
66
67
for _ , tc := range tests {
0 commit comments