Skip to content

node.js simple tests #1

@sokra

Description

@sokra

I tried to run this module with the Buffer tests from node
( https://github.com/joyent/node/blob/master/test/simple/test-buffer.js )

Tests run in Chrome 19.0.1084.52 m. May not all tests can be fixed...

I tried to omit duplicate errors.

This are the results:

https://github.com/joyent/node/blob/master/test/simple/test-buffer.js#L33

https://github.com/joyent/node/blob/master/test/simple/test-buffer.js#L48

TypeError: Object #<error> has no method 'copy'
    at Buffer.copy (buffer-browserify/index.js:598:22)

https://github.com/joyent/node/blob/master/test/simple/test-buffer.js#L186

AssertionError: "hello world" == "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"

writing and reading via buffer[number] does not work. This causes that error. (and that in L207)

https://github.com/joyent/node/blob/master/test/simple/test-buffer.js#L250

Error: Unknown encoding
    at Function.byteLength (buffer-browserify/index.js:58:13)
    at new Buffer (buffer-browserify/index.js:323:30)

Encodings: 'ucs2', 'utf-16le', 'binary'

https://github.com/joyent/node/blob/master/test/simple/test-buffer.js#L320

the base64 decoder should ignores whitespace and illegal chars.

Invalid string. Length must be a multiple of 4

https://github.com/beatgammit/base64-js/blob/master/lib/b64.js#L10 should throw an Error not a string!

https://github.com/joyent/node/blob/master/test/simple/test-buffer.js#L343

https://github.com/joyent/node/blob/master/test/simple/test-buffer.js#L379 and more

Invalid string. Length must be a multiple of 4

https://github.com/joyent/node/blob/master/test/simple/test-buffer.js#L432

TypeError: Object #<error> has no method 'binarySlice'
    at Buffer.toString (buffer-browserify/index.js:512:26)

https://github.com/joyent/node/blob/master/test/simple/test-buffer.js#L569

TypeError: Object #<error> has no method 'fill'
    at Buffer.fill (buffer-browserify/index.js:558:22)

https://github.com/joyent/node/blob/master/test/simple/test-buffer.js#L605

https://github.com/joyent/node/blob/master/test/simple/test-buffer.js#L623

https://github.com/joyent/node/blob/master/test/simple/test-buffer.js#L706

https://github.com/joyent/node/blob/master/test/simple/test-buffer.js#L719

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions