| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM. This provides coverage for a code branch that is not currently covered.
Sorry, something went wrong.
There was a problem hiding this comment.
Space between the ; and } please.
Sorry, something went wrong.
There was a problem hiding this comment.
This the type of thing that could and should be enforced via linting. So let's do that: #10377
Sorry, something went wrong.
There was a problem hiding this comment.
making the changes right away
Sorry, something went wrong.
There was a problem hiding this comment.
Same comment here.
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
Any reason not to just make it all one line, like this?:
assert.throws(() => { buf.readIntLE(5); }, RangeError);
Sorry, something went wrong.
There was a problem hiding this comment.
Or, if you prefer to split it up for readability, please indent by only two lines and put the closing parenthesis on a separate line:
assert.throws(
() => { buf.readIntLE(5); }, RangeError
);The indent-by-two-chars is something that should be caught by the linter but currently is not. I think it will start to be reported when we update our ESLint version. But there are a few obstacles to that at the moment.
Sorry, something went wrong.
There was a problem hiding this comment.
As mentioned above, if you could make this indented by just two characters, that would likely be preferable. Again, sorry our linter doesn't yet report that.
Sorry, something went wrong.
|
@cjihrig This PR has been updated to address your comments. Can you take a look and, if appropriate, update your review? |
Sorry, something went wrong.
|
@Trott I modified the linting as you said |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
minor nit: the formatting on this does not match the regular style...
Sorry, something went wrong.
There was a problem hiding this comment.
@jasnell Can you be more specific? To my mind, this would be OK if the indentation on line 13 was two spaces rather than six spaces. Is that your opinion too?
Sorry, something went wrong.
There was a problem hiding this comment.
Testing the error message would be more reliable here.
Sorry, something went wrong.
There was a problem hiding this comment.
@jasnell I do not get what you mean
Sorry, something went wrong.
There was a problem hiding this comment.
@larissayvette for example, doing a regex agains the error message thrown by RangeError in this case:
assert.throws(
() => {
buf.readUIntLE(5);
}, /Index out of range/
)
Sorry, something went wrong.
There was a problem hiding this comment.
ok thanks @jasnell
Sorry, something went wrong.
There was a problem hiding this comment.
I would take it a step further and match the entire message from beginning to end, since (currently) any change to an error message is considered a breaking change.
assert.throws(
() => {
buf.readUIntLE(5);
}, /^RangeError: Index out of range$/
)
Sorry, something went wrong.
|
Yes, that is what I meant with regards to indentation
…On Fri, Dec 23, 2016 at 9:09 AM Rich Trott ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In test/parallel/test-buffer-readuintle.js
<#10359>:
> @@ -0,0 +1,22 @@
+'use strict';
+require('../common');
+const assert = require('assert');
+
+// testing basic functionality of readUIntLE()
+
+const buf = Buffer.from([42, 84, 168, 127]);
+const result = buf.readUIntLE(2);
+
+assert.strictEqual(result, 168);
+
+assert.throws(
+ () => {
@jasnell <https://github.com/jasnell> Can you be more specific? To my
mind, this would be OK if the indentation on line 13 was two spaces rather
than six spaces. Is that your opinion too?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10359>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAa2eei4QelzhBaf0UHiAWEKXwGDZLbIks5rLAA-gaJpZM4LSOf_>
.
|
Sorry, something went wrong.
|
@cjihrig ... ping .. does this LGTY now? |
Sorry, something went wrong.
Sorry, something went wrong.
|
Previous CI run seems to have terminated oddly. Let's try again... |
Sorry, something went wrong.
|
(Failure on arm-fanned is CI infrastructure related and not a result of these changes.) |
Sorry, something went wrong.
PR-URL: nodejs#10359 Reviewed-By: Julian Duque <julianduquej@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
|
🎉 |
Sorry, something went wrong.
PR-URL: #10359 Reviewed-By: Julian Duque <julianduquej@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #10359 Reviewed-By: Julian Duque <julianduquej@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #10359 Reviewed-By: Julian Duque <julianduquej@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
|
this is failing on v4.x, is that expected? === release test-buffer-readuintle ===
Path: parallel/test-buffer-readuintle
assert.js:354
throw actual;
^
RangeError: index out of range
at checkOffset (buffer.js:696:11)
at Buffer.readUIntLE (buffer.js:704:5)
at /Users/thealphanerd/code/node/v4.x/test/parallel/test-buffer-readuintle.js:14:9
at _tryBlock (assert.js:313:5)
at _throws (assert.js:332:12)
at Function.assert.throws (assert.js:362:3)
at Object.<anonymous> (/Users/thealphanerd/code/node/v4.x/test/parallel/test-buffer-readuintle.js:12:8)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
Command: out/Release/node /Users/thealphanerd/code/node/v4.x/test/parallel/test-buffer-readuintle.js
|
Sorry, something went wrong.
|
The error message changed between 4.x and 6.x. This test gets deleted by a subsequent PR anyway (already marked as do-not-land-on-v4.x) so I'll label this similarly. |
Sorry, something went wrong.
PR-URL: #10359 Reviewed-By: Julian Duque <julianduquej@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #10359 Reviewed-By: Julian Duque <julianduquej@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)
test
Description of change
test readUIntLE() when noAsset is tfalse and when it is false