Created
May 8, 2011 16:02
-
-
Save jb55/961458 to your computer and use it in GitHub Desktop.
vows coffee
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vows.describe('binary-simple').addBatch | |
| 'a number': | |
| topic: new Buffer [0x74, 0x01, 0x00, 0x01] | |
| 'with a big endian byte order': | |
| 'parses correctly': (buf) -> | |
| res = binary.be buf, 3 | |
| assert.equal res, 7602432 | |
| 'parses correctly with offset': (buf) -> | |
| res = binary.be buf, 2, 1 | |
| assert.equal res, 256 | |
| 'with a little endian byte order': | |
| 'parses correctly': (buf) -> | |
| assert.isTrue(false, "not yet implemented") | |
| .export(module) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vows.describe('binary-simple').addBatch({ | |
| 'a number': { | |
| topic: new Buffer([0x74, 0x01, 0x00, 0x01]), | |
| 'with a big endian byte order': { | |
| 'parses correctly': function(buf) { | |
| var res; | |
| res = binary.be(buf, 3); | |
| return assert.equal(res, 7602432); | |
| }, | |
| 'parses correctly with offset': function(buf) { | |
| var res; | |
| res = binary.be(buf, 2, 1); | |
| return assert.equal(res, 256); | |
| } | |
| }, | |
| 'with a little endian byte order': { | |
| 'parses correctly': function(buf) { | |
| return assert.isTrue(false, "not yet implemented"); | |
| } | |
| } | |
| } | |
| }).export(module); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment