Skip to content

node.js simple tests #1

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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