@@ -44,7 +44,7 @@ assert.throws(() => {
44
44
} , {
45
45
code : 'ERR_OUT_OF_RANGE' ,
46
46
name : 'RangeError' ,
47
- message : 'The value of "offset" is out of range. It must be >= 0 && <= 4 . ' +
47
+ message : 'The value of "offset" is out of range. It must be >= 0. ' +
48
48
'Received -1'
49
49
} ) ;
50
50
@@ -73,7 +73,7 @@ assert.throws(() => {
73
73
code : 'ERR_OUT_OF_RANGE' ,
74
74
name : 'RangeError' ,
75
75
message : 'The value of "length" is out of range. ' +
76
- 'It must be >= 0 && <= 4 . Received -1'
76
+ 'It must be >= 0. Received -1'
77
77
} ) ;
78
78
79
79
@@ -110,7 +110,7 @@ assert.throws(() => {
110
110
code : 'ERR_OUT_OF_RANGE' ,
111
111
name : 'RangeError' ,
112
112
message : 'The value of "offset" is out of range. ' +
113
- 'It must be >= 0 && <= 4 . Received -1'
113
+ 'It must be >= 0. Received -1'
114
114
} ) ;
115
115
116
116
assert . throws ( ( ) => {
@@ -136,5 +136,18 @@ assert.throws(() => {
136
136
code : 'ERR_OUT_OF_RANGE' ,
137
137
name : 'RangeError' ,
138
138
message : 'The value of "length" is out of range. ' +
139
- 'It must be >= 0 && <= 4. Received -1'
139
+ 'It must be >= 0. Received -1'
140
+ } ) ;
141
+
142
+ assert . throws ( ( ) => {
143
+ fs . readSync ( fd ,
144
+ Buffer . allocUnsafe ( expected . length ) ,
145
+ 0 ,
146
+ expected . length + 1 ,
147
+ 0 ) ;
148
+ } , {
149
+ code : 'ERR_OUT_OF_RANGE' ,
150
+ name : 'RangeError' ,
151
+ message : 'The value of "length" is out of range. ' +
152
+ 'It must be <= 4. Received 5'
140
153
} ) ;
0 commit comments