File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ func DesiredWindowsBufferSize() int {
80
80
envVar := os .Getenv (WindowsBufferSizeEnvVar )
81
81
if envVar != "" {
82
82
size , err := strconv .Atoi (envVar )
83
- if err ! = nil {
83
+ if err = = nil {
84
84
return size
85
85
}
86
86
}
Original file line number Diff line number Diff line change @@ -23,6 +23,20 @@ import (
23
23
// Each implementation of the notify interface should have the same basic
24
24
// behavior.
25
25
26
+ func TestWindowsBufferSize (t * testing.T ) {
27
+ orig := os .Getenv (WindowsBufferSizeEnvVar )
28
+ defer os .Setenv (WindowsBufferSizeEnvVar , orig )
29
+
30
+ os .Setenv (WindowsBufferSizeEnvVar , "" )
31
+ assert .Equal (t , defaultBufferSize , DesiredWindowsBufferSize ())
32
+
33
+ os .Setenv (WindowsBufferSizeEnvVar , "a" )
34
+ assert .Equal (t , defaultBufferSize , DesiredWindowsBufferSize ())
35
+
36
+ os .Setenv (WindowsBufferSizeEnvVar , "10" )
37
+ assert .Equal (t , 10 , DesiredWindowsBufferSize ())
38
+ }
39
+
26
40
func TestNoEvents (t * testing.T ) {
27
41
f := newNotifyFixture (t )
28
42
defer f .tearDown ()
You can’t perform that action at this time.
0 commit comments